Repository navigation
refactor: one list resolver, one reminder resolver and one field-update applier in ReminderService - #24
Merged
Conversation
…te applier in ReminderService calendarInAllowlist and reminderInAllowlist replace four and three copies of "check the allowlist, then look it up" and its reverse, keeping each precedence. ReminderFieldUpdate.apply turns seven three-state switches in updateReminderImpl into one line each, in the same order. Date components take a ReminderDateValue on both paths, and makeAlarms validates and builds in one pass. The fetch completion is @sendable, so touching actor state inside it no longer compiles. The forEach format rule is back on and the complexity ceiling drops from 31 to 17. Claude-Session: https://claude.ai/code/session_01XR9wyQPT1iM8wzP9hvmYRu
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on GitHub release 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.
Twelfth of the refactoring series: the duplicated lookups and field switches in
ReminderServicecollapse, under the write-path tests from #23.Change
calendarInAllowlist(id:)checks the allowlist, then looks the list up. It replaces four copies.reminderInAllowlist(id:)looks the reminder up, then checks its list. It replaces three copies and keeps the hidden-looks-missing rule.ReminderFieldUpdate.applyturns seven three-state switches in the update path into one line each, in the same order. It is internal.ReminderDateValueon both paths, andmakeAlarmsvalidates and builds in one pass.@Sendable, so touching actor state inside it no longer compiles.Verification
swift test: 88 library tests and 107 server tests pass.Mutation record
calendarInAllowlistreminderInAllowlistthrowslistAccessDeniedpendingReminderFetchinside the fetch callbackRelease impact
None.
https://claude.ai/code/session_01XR9wyQPT1iM8wzP9hvmYRu