Repository navigation
fix: accept a pause_notifications effect without a scope - #102
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
Author
|
@doistbot /review |
doistbot
reviewed
Oct 14, 2026
doistbot
left a comment
Member
There was a problem hiding this comment.
This PR updates fix: accept a pause_notifications effect without a scope. No issues were flagged in the reviewed diff.
lmjabreu
marked this pull request as ready for review
October 14, 2026 00:41
scottlovegrove
approved these changes
Oct 14, 2026
doist-release-bot Bot
added a commit
that referenced
this pull request
Oct 14, 2026
## [3.4.1](v3.4.0...v3.4.1) (2026-10-14) ### Bug Fixes * accept a pause_notifications effect without a scope ([#102](#102)) ([d2ef405](d2ef405))
Contributor
|
🎉 This PR is included in version 3.4.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
Overview
UserStatusSchema(added in #100) requiredeffects.pauseNotifications.scope.mode. A Status can be written by other Todoist clients throughuser_update, and comms-ios decodesPauseNotificationsas an empty struct, so a storedpause_notifications: {}is plausible. The backend omits unset fields on this route, soscopecan come back absent andgetSessionUser/getUserthrow a ZodError for every caller.scopeandscope.modeare now optional.SetStatusArgsis unchanged.Reference
Found in the review of Doist/comms-cli#77, which reproduced the crash with a fake server returning
effects: {pause_notifications: {}}.Backend, read from
mainof Doist/comms-backend withgh api(not run):get_session_useris declared withresponse_model_exclude_unset=True(twist/domains/users/api.py).PauseNotificationsEffect.scopeis filled bydefault_factory(twist/models/dto/users.py), so ascopethat was never set is not serialised.Not verified: where the stored status is turned into
UserStatuson the read path. I looked intwist/models/user_views.pyanduser_profile.pyand did not find it, so I don't know whether the DTO is built by validation or by construction. If it is built by validation, the default would count as set andscopewould come back as{"mode": "all"}. Nothing was run against a real backend, so whether{}actually reaches the SDK withoutscopeis still unconfirmed. The change is safe either way, since it only loosens parsing.Changelog
Fix a crash when reading a user whose status pauses notifications without a scope.
Test plan
main, runnpx vitest run src/clients/users-client.test.ts. The new test "parses a pause_notifications effect stored without a scope" fails with a ZodError.npm test,npm run type-checkandnpm run check.🤖 Generated with Claude Code