{"record":{"id":"053e39b8910f5e8c","repo":"affaan-m/ECC","slug":"discussion-receipt-lookup-exceeded-page-budget","errorCode":null,"errorMessage":"discussion receipt lookup exceeded page budget","messagePattern":"discussion receipt lookup exceeded page budget","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/discord/release-announce.mjs","lineNumber":119,"sourceCode":"  if (discussion.category?.name !== 'Announcements') throw new Error('discussion is not an Announcement');\n  return { id: discussion.node_id, title: discussion.title, body: discussion.body, url: discussion.html_url };\n}\n\nasync function findReceiptComment(discussionId, marker) {\n  let cursor = null;\n  for (let page = 0; page < 50; page += 1) {\n    const data = await githubGraphql(\n      `query($id:ID!,$after:String){node(id:$id){... on Discussion{comments(first:100,after:$after){nodes{id body author{login}} pageInfo{hasNextPage endCursor}}}}}`,\n      { id: discussionId, after: cursor },\n    );\n    const comments = data.node?.comments;\n    if (!comments) throw new Error('discussion receipt lookup failed');\n    const receipt = findDiscussionReceipt(comments.nodes, marker);\n    if (receipt) return receipt;\n    if (!comments.pageInfo.hasNextPage) return null;\n    cursor = comments.pageInfo.endCursor;\n  }\n  throw new Error('discussion receipt lookup exceeded page budget');\n}\n\nasync function addReceiptComment(discussionId, body) {\n  const data = await githubGraphql(\n    `mutation($id:ID!,$body:String!){addDiscussionComment(input:{discussionId:$id,body:$body}){comment{id}}}`,\n    { id: discussionId, body },\n  );\n  return data.addDiscussionComment.comment.id;\n}\n\nasync function deleteReceiptComment(commentId) {\n  await githubGraphql(\n    `mutation($id:ID!){deleteDiscussionComment(input:{id:$id}){clientMutationId}}`,\n    { id: commentId },\n  );\n}\n\nasync function discord(method, path, body) {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/discord/release-announce.mjs#L101-L137","documentation":"findReceiptComment paginates discussion comments via GraphQL and caps at 50 pages (5000 comments); exhausting the budget without finding the receipt marker aborts rather than risking a duplicate announcement.","triggerScenarios":"Triggered when release-announce.mjs rejects the current invocation: discussion receipt lookup exceeded page budget","commonSituations":"Occurs while running scripts/discord/release-announce.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/discord/release-announce.mjs:119 aborts the command with this message.","solutions":["Review the constraint in the error message, correct the input accordingly, and re-run."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}