Stamp data URIs on alarm PendingIntents and add reminder model tests#91
Merged
Conversation
- Every task/reminder alarm intent now carries a unique data URI (choredash://alarm/...), so two ids with colliding String.hashCode() request codes can no longer cancel or clobber each other's alarms; filterEquals ignores extras, so the bare shared intent was the only thing distinguishing them before - BootWorker sweep-cancels alarms registered under the old no-URI identity so they don't double-fire after the update - Extract the pending-reminder predicate into the model (ReminderDto.needsScheduling) and add unit tests for it and for the instant-parsing helpers, locking in the past-due-inclusion behaviour Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qs1UZLKHTxtaLpTheoUwTg
…rs-analysis-w9qkm8 # Conflicts: # LESSONS.md
mapgie
pushed a commit
that referenced
this pull request
Jul 13, 2026
Rebased onto main and numbered #32 to avoid the LESSONS.md numbering collision with the custom-theme accents PR (#30, surfaces moved to #29) and the alarm-identity PR #91 (which takes #31). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0154oNEvwJNtprknEQfFAyND
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.
Follow-up round from the cross-app alarms/reminders review, addressing the remaining cross-cutting concerns.
Alarm identity
PendingIntent identity is (request code +
Intent.filterEquals), andfilterEqualsignores extras. All alarm intents wrapped the same bareIntent(context, AlarmReceiver::class.java), so the hashCode-derived request codes were the only thing keeping task and reminder alarms apart; two ids with colliding hashes would silently cancel or clobber each other's alarms. Every alarm intent is now stamped with a unique data URI (choredash://alarm/task/<id>,choredash://alarm/reminder/<id>), the same defence GaMeD adopted after hitting this collision class (see its LESSONS entry). BootWorker sweep-cancels alarms registered under the old no-URI identity so they don't double-fire after the update (it runs onMY_PACKAGE_REPLACED).Tests
The pending-reminder predicate moves out of the repository into the model as
ReminderDto.needsScheduling(), and a new JVM test suite covers it plus the instant-parsing helpers, locking in the past-due-inclusion behaviour from the previous PR (a reminder that came due while the phone was off must be delivered late, not dropped). First unit tests in this repo.Changelog fragment:
changelog/unreleased/alarm-identity.json(patch). LESSONS.md gains entry 31 building on entry 13 (request-code namespacing is only half of PendingIntent identity).a11y_check.pypasses.Merged
origin/mainback into the branch to resolve a LESSONS.md numbering conflict (main added lessons 29 and 30 in the meantime, so the new entry became 31; both sides kept in full).🤖 Generated with Claude Code
https://claude.ai/code/session_01Qs1UZLKHTxtaLpTheoUwTg