Add read-after-write verification for task mutations#12
Open
partymola wants to merge 1 commit into
Open
Conversation
Verify API responses after create, update, and complete operations. If the returned task doesn't match what was sent (e.g. missing dates, wrong priority), a _verification_warnings field is added to the response so the caller can detect and report the issue. Also includes prior local patches: create_task now preserves dates/ reminders that builder() drops, and update_task uses exclude_unset to avoid wiping unmodified fields.
9ad7cf6 to
91d368a
Compare
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.
Summary
verification.pywithverify_mutation()helper that compares API responses against expected fieldsticktick_create_task,update_task, andticktick_complete_task_verification_warningslist so the caller can detect data lossMotivation
Three bugs caused silent data loss: update wiped dates when only changing priority, create dropped dates/reminders via builder(), and None state crashed get_by_id. All are now patched. This verification layer catches any future regressions at write time.
Test plan
pytest tests/test_verify_mutation.py- 24 tests pass