[GH-ISSUE #1521] Profile import: modern collections path still full-replaces collections absent from the file #770

Closed
opened 2026-10-20 17:33:09 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Romuromylus on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1521

Originally assigned to: @Romuromylus on GitHub.

Follow-up to #1512 (fixed for the legacy table path in #1518).

#1518 made the legacy import path (fileStorage.tables) skip-absent: a collection whose table key is missing from the file is left untouched instead of wiped. The modern data.collections import path (src-tauri/src/commands/storage/profile.rs, import_profile_collections_with_restored_assets) still rebuilds replacements for every mapped collection and falls back to an empty array for ones absent from the file, so a partial modern-format profile would still wipe the collections it omits.

In practice the refactor's own exports are always full backups, so this is not triggered by a normal export/import round-trip. But a hand-built or partial modern-format file has the same data-loss shape #1512 described for the legacy path.

Suggested: apply the same present-key guard to the modern collections path so absent collections are left untouched, while present-but-empty still clears.

Originally created by @Romuromylus on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1521 Originally assigned to: @Romuromylus on GitHub. Follow-up to #1512 (fixed for the legacy table path in #1518). #1518 made the **legacy** import path (`fileStorage.tables`) skip-absent: a collection whose table key is missing from the file is left untouched instead of wiped. The **modern** `data.collections` import path (`src-tauri/src/commands/storage/profile.rs`, `import_profile_collections_with_restored_assets`) still rebuilds replacements for every mapped collection and falls back to an empty array for ones absent from the file, so a partial modern-format profile would still wipe the collections it omits. In practice the refactor's own exports are always full backups, so this is not triggered by a normal export/import round-trip. But a hand-built or partial modern-format file has the same data-loss shape #1512 described for the legacy path. Suggested: apply the same present-key guard to the modern collections path so absent collections are left untouched, while present-but-empty still clears.
bsakaguchi 2026-10-20 17:33:09 +07:00
Author
Owner

@Romuromylus commented on GitHub (May 30, 2026):

Fixed by #1633, merged into refactor.

<!-- gh-comment-id:4582246723 --> @Romuromylus commented on GitHub (May 30, 2026): Fixed by #1633, merged into `refactor`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#770
No description provided.