Skip to content

refactor: one list resolver, one reminder resolver and one field-update applier in ReminderService - #24

Merged
k3KAW8Pnf7mkmdSMPHz27 merged 1 commit into
mainfrom
refactor/service-resolvers
Oct 4, 2026
Merged

k3KAW8Pnf7mkmdSMPHz27 merged 1 commit into
mainfrom
refactor/service-resolvers

Conversation

@k3KAW8Pnf7mkmdSMPHz27

Copy link
Copy Markdown
Owner

Twelfth of the refactoring series: the duplicated lookups and field switches in ReminderService collapse, 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.apply turns seven three-state switches in the update path into one line each, in the same order. It is internal.
  • 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 cyclomatic-complexity ceiling drops from 31 to 17.

Verification

Mutation record

Mutation Failing tests
Swap the two guards in calendarInAllowlist A list query checks the allowlist before looking the list up; Create checks the allowlist before looking the list up; Deleting a list checks the allowlist before looking it up; Moving a reminder checks the allowlist before looking the target list up
reminderInAllowlist throws listAccessDenied A reminder in a hidden list reads, updates and deletes like a missing one
Apply alarms before the start date Update applies the start date before validating relative alarms
Read pendingReminderFetch inside the fetch callback Does not compile: "actor-isolated property 'pendingReminderFetch' can not be referenced from a Sendable closure"

Release impact

None.

https://claude.ai/code/session_01XR9wyQPT1iM8wzP9hvmYRu

…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
@k3KAW8Pnf7mkmdSMPHz27
k3KAW8Pnf7mkmdSMPHz27 merged commit 9b65fab into main Oct 4, 2026
3 checks passed
@k3KAW8Pnf7mkmdSMPHz27
k3KAW8Pnf7mkmdSMPHz27 deleted the refactor/service-resolvers branch October 4, 2026 15:45
@eventkit-tap-bumper

Copy link
Copy Markdown

🎉 This PR is included in version 3.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant