[TTAHUB-5374] Fix collab report export#3660
Merged
Merged
Conversation
All tests in the getCSVReports describe block now create their own approved CollabReport records in beforeAll and clean them up in afterAll. Queries are scoped via 'id.in' to prevent interference from ambient database state, replacing fragile 'length >= 2' assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes collaboration report CSV export so the backend defaults to returning all matching reports instead of applying the paginated table default.
Impact assessment: Benefits: medium. Risks: low.
Changes:
- Updates
getCSVReportsdefaultlimitfrom10to'all'. - Adjusts service tests to scope CSV export assertions to dedicated seeded reports.
- Updates expectations to reflect all matching records being returned by default.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/services/collabReports.ts |
Changes CSV export default pagination behavior. |
src/services/collabReports.test.js |
Updates CSV export tests and fixtures for the new default behavior. |
…default Creating only 2 records meant the old REPORTS_PER_PAGE=10 default would still return all records, so the 'uses default parameters' test passed regardless of whether the limit was 'all' or 10. With 11 records (one more than REPORTS_PER_PAGE), arrayContaining(csvReportIds) can only succeed when the query has no limit — proving getCSVReports truly omits pagination for CSV exports. Also updates the sort test's toHaveLength(2) to toHaveLength(csvReportIds.length) to stay accurate with the larger fixture set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AdamAdHocTeam
approved these changes
Jun 1, 2026
|
|
|
✅ Diff size: 120 lines — within the 500-line guideline. |
📊 Review Metrics
Review Timeline
|
hardwarehuman
pushed a commit
that referenced
this pull request
Jun 4, 2026
* Fix collab report export * test: make getCSVReports tests self-contained with own fixtures All tests in the getCSVReports describe block now create their own approved CollabReport records in beforeAll and clean them up in afterAll. Queries are scoped via 'id.in' to prevent interference from ambient database state, replacing fragile 'length >= 2' assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test: expand getCSVReports fixtures to 11 records to prove unlimited default Creating only 2 records meant the old REPORTS_PER_PAGE=10 default would still return all records, so the 'uses default parameters' test passed regardless of whether the limit was 'all' or 10. With 11 records (one more than REPORTS_PER_PAGE), arrayContaining(csvReportIds) can only succeed when the query has no limit — proving getCSVReports truly omits pagination for CSV exports. Also updates the sort test's toHaveLength(2) to toHaveLength(csvReportIds.length) to stay accurate with the larger fixture set. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Update collab report model with a transformed virtual field * Fix unit tests for transformers * Add encoding, update test --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of change
The export table isn't operating correctly; when you select export table you get only the first 10 entries. This PR fixes the parameter mismatch causing the issue
We don't currently need to add streaming or other solution to large exports to this, in my opinion. After nearly six months, we have between 100-200 reports and performance is near instantaneous.
How to test
Attempt to export collab reports; observe that all reports are exported.
Issue(s)
Checklists
Every PR
Before merge to main
Production Deploy
ready_for_reviewtransition triggers the Slack/Jira automation)elainaparrishis the authorized approver under normal circumstances)After merge/deploy