mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1633] [MERGED] Guard modern profile import against wiping absent collections #5165
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5165
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1633
Author: @Romuromylus
Created: 5/30/2026
Status: ✅ Merged
Merged: 5/30/2026
Merged by: @Romuromylus
Base:
refactor← Head:fix/profile-import-modern-skip-absent📝 Commits (1)
9c060c3Guard modern profile import against wiping absent collections📊 Changes
1 file changed (+92 additions, -3 deletions)
View changed files
📝
src-tauri/src/commands/storage/profile.rs(+92 -3)📄 Description
Why this change
Follow-up to #1521. #1518 fixed the legacy table import path so a partial backup leaves collections it omits untouched instead of wiping them. The modern
data.collectionspath (import_profile_collections_with_restored_assets) still rebuilt a replacement for every known collection, falling back to an empty array for any collection the file omitted. A partial or hand-built modern-format profile therefore wiped every collection it did not carry, the same data-loss shape #1512 described for the legacy path.The refactor's own exports are always full backups, so a normal export/import round-trip never hit this. A hand-built or partial modern file did.
What changed
src-tauri/src/commands/storage/profile.rs: in the modern collections loop, skip collections absent from the file (leaving the user's existing data untouched) and reject a present-but-non-array collection instead of coercing it to an empty array. A present-but-empty array is still treated as a deliberate clear. This mirrors the #1518 legacy guard exactly.Verification
pnpm checkpasses locally (architecture + frontend tsc + cargo check + docs).cargo clippy --workspace --all-targets -- -D warningsclean.profilemodule suite (30 tests) green.The end-user trigger (importing a hand-built/partial modern-format profile) is reached through the native file picker, which is not driven by the automated tiers; the storage-layer behavior it depends on is fully covered by the new tests.
Linked issue
Closes #1521.
Summary by CodeRabbit
Release Notes
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.