Fix rank merges on delta vibe#582
Merged
MarcelGeo merged 5 commits intodev-r85-v2-pullfrom Feb 20, 2026
Merged
Conversation
- previous fix of AI was bad beacuse it added all changes to database (delta file)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses incorrect delta results when merging cached delta checkpoints across rank/chunk boundaries, particularly around delete+create/recreate edge cases (“rank merges on delta vibe”). It adjusts change-merge rules to preserve correct client outcomes and adds regression coverage for the cross-checkpoint scenarios.
Changes:
- Updates
ProjectVersionDelta.merge_changes/_compare_changesto better handle CREATE/DELETE/CREATE sequences across checkpoints (including introducing a “force update” path). - Adds regression tests for cross-checkpoint create→delete→recreate and recreate→delete scenarios.
- Updates existing delta-change expectations where delete+create sequences should be represented as
UPDATErather thanCREATE.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
server/mergin/sync/models.py |
Adjusts delta merge comparison rules and introduces a FORCE_UPDATE action to avoid losing delete+create semantics across checkpoints. |
server/mergin/tests/test_public_api_v2.py |
Adds cross-checkpoint regression tests and updates expected delta change types for delete+create behavior. |
Comments suppressed due to low confidence (1)
server/mergin/tests/test_public_api_v2.py:35
- This file now imports from
.utilstwice (with overlapping names) and the PR adds another symbol to the second block. Consider consolidating into a single.utilsimport to avoid duplicate/overlapping imports (which can also hide unused-import issues).
from .utils import (
add_user,
create_blank_version,
create_project,
create_workspace,
diffs_are_equal,
execute_query,
login_as_admin,
push_change,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request Test Coverage Report for Build 22226588552Details
💛 - Coveralls |
varmar05
reviewed
Feb 20, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
varmar05
approved these changes
Feb 20, 2026
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.
Related to https://github.com/MerginMaps/server-private/issues/3221
added update action if delete create, this is handling all cases.
added improvment to rules for mergin to fix edge cases when global checkpoints are merging together
we just added UPDATE action when DELETE + CREATE