Conversation
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.
PR Checklist
What is the current behavior?
Settings > Data Backup exports connection records without collection entities. Recovery clears every connection's parent ID. With Group1/Group2 and one connection in each, recovering the JSON on another installation puts both connections at the root and loses the groups.
Issue Number
Refs #1255
What is the new behavior?
JSON retains its top-level array and adds flat group records with
isCollection: true,id,name,parentId, andorderId. Restore groups in parent order and preserve nested/empty groups, ordering, and connection membership. Single-connection JSON includes only its ancestor groups; other export formats retain their existing connection/message output. Messages continue to stream on export and import in batches.Older connection-only backups remain importable and recover at the root. Repeated imports update matching entity IDs. Reject duplicate IDs, group/connection ID collisions, child IDs owned by another connection, missing group references, and cycles. Restore all entities and closure-table relationships in one transaction; failures return an error and roll back the entire backup. Reuse the existing entity converters and subscription/message services with transaction-scoped repositories.
The import form accepts group records only for JSON, clears stale file selections, and waits for legacy CSV parsing before validating. Streamed JSON omits undefined fields so restored legacy connections without a will can be exported. English and Chinese documentation describe the format and conflict behavior. Script backup (#1309) is outside this change.
Does this PR introduce a breaking change?
JSON backups containing group records require a Desktop version supporting this format. Older Desktop importers cannot read those group records. Incoming legacy connection-only backups and the other export formats remain supported; no database schema migration is added.
Specific Instructions
Local validation on macOS, Node 22.15.0, TypeORM 0.2.34 / native sqlite3 5.1.6 (SQLite 3.41.1):
No data to export. Both pass after the change.tsc --noEmit, changed-file ESLint/Prettier,git diff --check, and Electron renderer/main production bundling with--skipElectronBuildpass./tmpto prevent application data migration from copying a personal database.03222d352aafb35a4ba3e0f701940d8158b186ae: Desktop unit tests (402 passing), Desktop lint, and macOS, Windows, and Linux packaging. Linux packaging initially failed while downloading the AppImage tool with a connection reset; the failed job passed on retry without code changes.Other information
Manual Desktop verification still needed:
Focused automated check:
NODE_OPTIONS=--openssl-legacy-provider yarn test:unit tests/unit/database/connectionBackup.spec.ts tests/unit/components/ImportData.spec.ts tests/unit/utils/jsonStreamWriter.spec.ts.