objectbox / objectbox/objectbox-dart
@Unique with replace strategy that update instead of deleting and inserting a new one
Nobody has claimed this yet.
- Dominant language
- Dart
- Stars
- 1.2k
- Forks
- 162
- Avg merge
- 15m
- Merged PRs (30d)
- 1
Description
Right now, @Unique with conflict: ConflictStrategy.replace remove the old object and insert a new one, this behavior causes a null relation if there's data that has relation to the old object(the one before deleting), and after deleting and inserting a new object, the related item's relations aren't updated to the new object.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing an @Unique conflict using ConflictStrategy.replace with another object that has a relation to the existing object. Trace how the old object is removed and the replacement is inserted, then verify that related objects retain valid relations after the conflict is resolved. Done means replacement updates the existing object without leaving related data pointing at a deleted object.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100