fix(knowledge): serve list totals when a request omits the count flag
Merged
WA
1mo ago+34+34+01234567890123456789-5-5-0123456789
Summary
- #8329 added
includeCountsto the internalGET /api/knowledgelist, defaulting to false, and madetokenCountoptional in the response. A page loaded before that deploy sends no flag, and its contract still requirestokenCounton every row, so every knowledge base list in an open tab (the Knowledge page, KB selector, search modal, mentions, resource tabs) fails contract validation until the tab reloads - A missing flag now means counted. Current clients always send it:
fetchKnowledgeBasespasses an explicit boolean, andappendQueryserializesfalse. So only a pre-flag page gets the totals it requires, and the counts still go through the reader's access - The Copilot mention picker omitted the flag and only reads id and name, so it now sends
includeCounts: false - No other response shape in the release became optional or dropped a field. I diffed every contract between main and staging
Type of Change
- Bug fix
Testing
- Parsing the list query: no flag → counted,
false→ uncounted,true→ counted - Lint, all 51 audits, type-check, and the knowledge query/application/page suites (594 tests) pass
Checklist
- Code follows project style guidelines
- Self-reviewed my changes
- Tests added/updated and passing
- No new warnings introduced
- I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)