Fix: Update attachments in BE instead of cloning record - #8400
Open
CarolineDenis wants to merge 5 commits into
Open
Fix: Update attachments in BE instead of cloning record#8400CarolineDenis wants to merge 5 commits into
CarolineDenis wants to merge 5 commits into
Conversation
|
Warning One or more dependencies are approaching or past End-of-Life. |
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughChangesAttachment identity preservation
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Author
|
@CodeRabbit full review |
Contributor
✅ Action performedFull review finished. |
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.
Fixes #8298
Changes
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
Notes:
Attachments were cloned because:
In upload_table.py:986:
So when we changed attachment fields, the old record often no longer matched the match predicate, and the fallback was “create via clone” from current_id, which produced duplicate attachments.
For many non-one-to-one relationships, Specify treats records as potentially reusable/shared and avoids unconditional in-place mutation, that conservative default is useful broadly.
==> preserveIdentity flips that specific to-one node from match/clone semantics to forced in-place save when there is an existing id
Next
A better long-term model is an explicit per-node update strategy in the upload plan.
Each table instance in the relationship graph explicitly declares how updates should behave, instead of relying on one global default.
Summary by CodeRabbit
Bug Fixes
New Features