-
Couldn't load subscription status.
- Fork 1
fix constraint violation on sync #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update refactors the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as SnapshotTests
participant Repo as CrdtRepository
participant Db as DbContext
Test->>Repo: AddSnapshots(snapshots)
loop For each group by deletion status (deleted first)
Repo->>Db: Add snapshots in group
Repo->>Repo: ProjectSnapshot for new EntityIds
Repo->>Db: SaveChangesAsync()
alt Exception occurs
Repo->>Repo: Handle exception
end
end
Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code Graph Analysis (1)src/SIL.Harmony.Sample/Changes/TagWordChange.cs (1)
🔇 Additional comments (5)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Group and process snapshots by deletion status to ensure deletes are prioritized during entity synchronization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
related to sillsdev/languageforge-lexbox#1615
WordTags are linking objects between a word and a tag. There is a constraint that there can only be one row with the same tag and word id. If a sync comes in that creates a word tag which already exists, but the commit precedes the local word tag we run into this constraint violation.
Summary by CodeRabbit
Bug Fixes
Tests
Refactor