fix(reminder): refresh calendar location list after a reminder is confirmed - #368
Conversation
…firmed confirm() only wrote the local SQLite disposition state; the calendar screen reads location schedules through a separate service that never learned about the change, so a confirmed location reminder stayed visible until the app restarted. LocalReminderApplication now emits an onScheduleConfirmed event that HomeScreen folds into its existing calendar refreshSignal.
There was a problem hiding this comment.
Reviewed the complete fixed diff for the reminder-confirmation refresh path. The new subscription is wired from confirmInternal after the local disposition/runtime writes and registration teardown, and HomeScreen folds it into the existing refreshSignal, which causes the calendar location query to re-read the now-confirmed row. The interface, unsubscribe behavior, and both integration points are covered by focused tests.
No actionable correctness, reliability, security, or maintainability findings identified.
Verification: git diff --check passed. Automated Jest/typecheck execution was unavailable because this checkout has no executable local node_modules/.bin toolchain (vitest/tsc reported Permission denied).
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
npm run check caught this in CI after the previous commit — the useEffect arrow-function argument list didn't match Prettier's formatting.
Fixes #367
Summary
LocalReminderApplication.confirmInternal确认提醒时只写本地 SQLite(state.setDisposition+patchRuntime),没有通知日历页重取。SqliteScheduleClientService.getLocationSchedules(),是完全独立的一条读取路径,不知道提醒引擎这边发生了写入;之前只有语音写日程会带动refreshSignal。ReminderApplicationPort加一个onScheduleConfirmed订阅(跟现有的onPermissionBlocked是同一种模式),confirmInternal写完本地状态后触发一次;HomeScreen订阅它,累加进现有的refreshSignal,跟语音写日程走同一条重取路径。confirm,没有处理snooze——snoozed状态不影响地点提醒列表的可见性(只有confirmed会被getLocationSchedules()过滤掉),改 snooze 没意义。Test plan
LocalReminderApplication.test.ts两个用例:confirm()触发onScheduleConfirmed、register()不触发、取消订阅后不再触发。HomeScreen.test.tsx用例:reminder.onScheduleConfirmed触发的监听器被调用后,日历会重新调用getLocationSchedules。npm run lint/npm run typecheck/npm run test(jest 712 + vitest 87)全绿。🤖 Generated with Claude Code