-
Notifications
You must be signed in to change notification settings - Fork 60
Added to_version as latest project version to delta reponse + another response updates #547
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
…action integrity in clients: - improve handling of empty delta if since equals to to (or latest project version) -> returns items: []
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.
Pull request overview
This PR adds a to_version field to the project delta API response and modifies the validation logic to allow queries where since equals to (previously returned a 400 error). This change enables clients to poll the delta endpoint without errors when no changes have occurred since their last sync.
Key Changes:
- Added
to_versionfield to delta response schema to indicate the target version - Modified validation to allow
since == toqueries, returning an empty items list instead of an error - Updated error messages to be more descriptive and contextually appropriate
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| server/mergin/sync/public_api_v2_controller.py | Updated validation logic to allow since == to, refactored error messages, and added to_version to response |
| server/mergin/sync/files.py | Added to_version field to DeltaChangeRespSchema with required=True |
| server/mergin/sync/public_api_v2.yaml | Added to_version property to ProjectDeltaResponse schema and minor formatting fix |
| server/mergin/tests/test_public_api_v2.py | Added test assertions for to_version field, new test for since==to case, removed old test that expected 400 for same versions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request Test Coverage Report for Build 20166872065Details
💛 - Coveralls |
| """Schema for diff file path in diffs list""" | ||
|
|
||
| path = fields.String(required=True) | ||
| id = fields.String(required=True) |
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.
update also docstring
When pulling transaction starts in clients, we need to know in which version s client operating to perform successfull project info and finish of pull.
Other: