Repository navigation
Account-scoped sync, if_in_state, paged search_events - #71
Merged
Merged
Conversation
Documentation build overview
10 files changed ·
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Closes #68.
Closes #69.
create_event,send_invite,update_event, anddelete_eventnow accept an optionalif_in_state. When the account's state has moved past it, the server rejects the write withstateMismatchrather than applying over a change you never saw.get_objects_by_sync_tokenandget_tasks_by_sync_tokennow return one page at a time. Previously,hasMoreChanges: truemade the client raise and the page'snewStatewas lost. The return shape moves from a 4-tuple to a 6-tuple:(added, modified, deleted, old_state, new_state, has_more_changes). Call again withnew_statewhenhas_more_changesis true. I changed this from what #69 originally described, which had the method follow every page itself and merge them into a single result before returning. A caller interrupted mid-sync needs to persist progress between pages, and a merged result gives it nothing to persist, so I rewrote the issue text to match what's here. Both methods also take an optionalmax_changes, to bound a page or to force paging in a test.get_sync_token,get_objects_by_sync_token,get_task_sync_token, andget_tasks_by_sync_tokentake an optionalaccount_idnow, the same parameter every other account-aware method on this client already has. Neither method had it before. There was no issue filed for this specifically, it was small enough to fix alongside the rest of this PR.search_eventstakesposition,limit, andcalculate_totalnow, and returns anEventSearchResultinstead of a bare list..eventsis what the method used to return on its own..positionand.totalcome straight from the server'sCalendarEvent/queryresponse..totalis set only whencalculate_total=Truewas actually passed, never inferred from whether the server's response happened to include one, because Cyrus sendstotalback unconditionally even whencalculateTotalwas never requested, against what the spec says it should do. This is a breaking change tosearch_events's return type, and it had no issue filed either, same reasoning as above.#67 stays out of this PR. It depends on #66 landing first.