affaan-m/ECC · error · Error

discussion receipt lookup exceeded page budget

Error message

discussion receipt lookup exceeded page budget

What it means

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.

Source

Thrown at scripts/discord/release-announce.mjs:119

  if (discussion.category?.name !== 'Announcements') throw new Error('discussion is not an Announcement');
  return { id: discussion.node_id, title: discussion.title, body: discussion.body, url: discussion.html_url };
}

async function findReceiptComment(discussionId, marker) {
  let cursor = null;
  for (let page = 0; page < 50; page += 1) {
    const data = await githubGraphql(
      `query($id:ID!,$after:String){node(id:$id){... on Discussion{comments(first:100,after:$after){nodes{id body author{login}} pageInfo{hasNextPage endCursor}}}}}`,
      { id: discussionId, after: cursor },
    );
    const comments = data.node?.comments;
    if (!comments) throw new Error('discussion receipt lookup failed');
    const receipt = findDiscussionReceipt(comments.nodes, marker);
    if (receipt) return receipt;
    if (!comments.pageInfo.hasNextPage) return null;
    cursor = comments.pageInfo.endCursor;
  }
  throw new Error('discussion receipt lookup exceeded page budget');
}

async function addReceiptComment(discussionId, body) {
  const data = await githubGraphql(
    `mutation($id:ID!,$body:String!){addDiscussionComment(input:{discussionId:$id,body:$body}){comment{id}}}`,
    { id: discussionId, body },
  );
  return data.addDiscussionComment.comment.id;
}

async function deleteReceiptComment(commentId) {
  await githubGraphql(
    `mutation($id:ID!){deleteDiscussionComment(input:{id:$id}){clientMutationId}}`,
    { id: commentId },
  );
}

async function discord(method, path, body) {

View on GitHub (pinned to 06c5e118c4)

Solutions

  1. Review the constraint in the error message, correct the input accordingly, and re-run.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Triggered when release-announce.mjs rejects the current invocation: discussion receipt lookup exceeded page budget

Common situations: 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.


AI-assisted analysis of affaan-m/ECC@06c5e118c4 (2026-08-18). Data as JSON: /api/errors/053e39b8910f5e8c. Report an issue: GitHub.