{"record":{"id":"f2dca37c8fddd53c","repo":"abhigyanpatwari/GitNexus","slug":"context-query-text-is-math-round-bytes-102","errorCode":null,"errorMessage":"${context}: query text is ${Math.round(bytes / 1024)} KB. A list spliced into query text grows the expression the engine has to parse and can overflow its evaluator stack (#2915) — bind the list as a parameter (WHERE x IN $list), or chunk it.","messagePattern":"(.+?): query text is (.+?) KB\\. A list spliced into query text grows the expression the engine has to parse and can overflow its evaluator stack \\(#2915\\) — bind the list as a parameter \\(WHERE x IN \\$list\\), or chunk it\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/lbug/query-batch.ts","lineNumber":105,"sourceCode":"/**\n * Warn when a query looks like it was built by string-concatenating a\n * caller-sized list. Never throws: a long query that the engine can actually\n * run must not start failing because of a heuristic.\n */\nexport function warnIfQueryTextUnbounded(\n  cypher: string,\n  context: string,\n  warn: (message: string) => void,\n): void {\n  // `cypher.length` counts UTF-16 code units, and what reaches the engine is\n  // UTF-8 bytes — non-ASCII query text is undercounted by up to 3x. UTF-8 never\n  // needs more than 3 bytes per code unit (an astral character costs 4 bytes\n  // across 2 units), so a query short enough here cannot exceed the ceiling and\n  // never pays for the byte count. This runs on every read query.\n  if (cypher.length * 3 <= QUERY_TEXT_CEILING_BYTES) return;\n  const bytes = Buffer.byteLength(cypher, 'utf8');\n  if (bytes <= QUERY_TEXT_CEILING_BYTES) return;\n  warn(\n    `${context}: query text is ${Math.round(bytes / 1024)} KB. A list spliced into query ` +\n      `text grows the expression the engine has to parse and can overflow its evaluator stack ` +\n      `(#2915) — bind the list as a parameter (WHERE x IN $list), or chunk it.`,\n  );\n}\n","sourceCodeStart":87,"sourceCodeEnd":111,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/aac7515d2a8c50a1f8f923c6fb77218b333560d6/gitnexus/src/core/lbug/query-batch.ts#L87-L111","documentation":"Error \"${context}: query text is ${Math.round(bytes / 1024)} KB. A list spliced into query text grows the expression the engine has to parse and can overflow its evaluator stack (#2915) — bind the list as a parameter (WHERE x IN $list), or chunk it.\" thrown in abhigyanpatwari/GitNexus.","triggerScenarios":"Thrown at gitnexus/src/core/lbug/query-batch.ts:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"aac7515d2a8c50a1f8f923c6fb77218b333560d6","analyzedAt":"2026-08-20T23:29:22.980Z","contentChangedAt":"2026-08-20T23:29:22.980Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}