TT-7180 limit data on export, throw on unhandled tables - #577
TT-7180 limit data on export, throw on unhandled tables#577sarahentzel wants to merge 8 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Confirmed issues in the new/refactored export/import logic can cause incorrect media version selection, possible export crashes on null relations, and unintended offline-project mutations for supporting projects.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Refactors the renderer-side export pipeline to centralize table record collection, reduce exported data to the intended project/org scope, and hard-fail on any newly introduced/unsupported table types during export.
Changes:
- Introduces
createExportCollector(exportTableRecs.ts) and reuses it from bothelectronExportandprojectDataExportto unify table selection/scoping logic. - Updates project and organization export outputs to better respect “online vs offline” cohorts and adds support for exporting supporting orgs alongside supporting projects.
- Adds a comprehensive Jest test suite for
getProjectDataFilesscoping behavior and updates import handling to distinguish supporting org/project rows.
File summaries
| File | Description |
|---|---|
| src/renderer/src/store/importexport/projectDataExport.ts | Switches PTF project data export to use the shared export collector and adds supporting org exports. |
| src/renderer/src/store/importexport/projectDataExport.test.ts | Adds tests validating export scoping across online/offline cohorts and supporting-resource scenarios. |
| src/renderer/src/store/importexport/exportTableRecs.ts | New shared collector that scopes/export-selects records per table and throws on unhandled tables. |
| src/renderer/src/store/importexport/electronExport.tsx | Refactors Electron zip export to use the shared collector and exports supporting orgs. |
| src/renderer/src/store/importexport/actions.tsx | Passes additional flags during import to distinguish primary vs supporting org/project rows. |
| src/renderer/src/schema.tsx | Adds offlineId to the sectionresourceuser schema. |
| src/renderer/src/model/sectionResourceUser.ts | Adds offlineId to the SectionResourceUser model attributes. |
| src/renderer/src/model/orgKeyterm.tsx | Normalizes offlineid → offlineId in the OrgKeyterm model. |
| src/renderer/src/crud/loadData.ts | Adjusts import insertion behavior to avoid altering offline-project bookkeeping for supporting projects. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
Electron export now always writes an empty supportingprojects JSON file when there are none, and the newly added isOrganization flag in insertData is currently dead code, suggesting incomplete/inconsistent behavior.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 2
- Review effort level: Lite
| record.type === 'project' | ||
| ? isProject | ||
| : record.type === 'organization' | ||
| ? isOrganization | ||
| : false; |
| ret.Added = recs.length; | ||
| await AddJsonEntry('supportingprojects', recs, 'Z'); | ||
| let orgs = supportingOrgs(project); |
include supporting orgs for categories
remove one project check to simplify
fix highestbypassage
remove duplicate burrito export logic do not allow graphic editing offline only send an artifact type if the export will care about it - otherwise the file will be misnamed
No description provided.