Skip to content

fix: chunk support issue message stats query to avoid SQL parameter limit#3634

Open
bernd2022 wants to merge 1 commit intodevelopfrom
fix/support-issue-list-param-limit
Open

fix: chunk support issue message stats query to avoid SQL parameter limit#3634
bernd2022 wants to merge 1 commit intodevelopfrom
fix/support-issue-list-param-limit

Conversation

@bernd2022
Copy link
Copy Markdown
Collaborator

Summary

  • GET /v1/support/issue/list failed with The incoming request has too many parameters. The server supports a maximum of 2100 parameters when more than ~2100 issues matched the filter.
  • Root cause: getMessageStats passed all issue IDs into a single IN (:...ids) clause; TypeORM emits one parameter per ID and SQL Server rejects the query above 2100.
  • Fix: chunk the message stats query in batches of 1000 IDs and merge the results into a single map. No API change, identical result set per issue.

Test plan

  • npx prettier --check on the changed file
  • npx eslint on the changed file
  • npm test (927 passed, 0 failed)
  • Verify /v1/support/issue/list succeeds on a dataset with >2100 matching issues

Copy link
Copy Markdown
Member

@davidleomay davidleomay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use Util.doInBatches?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants