feat: self-serve trip-alert toggle on /trips — PR 2/2#11
Merged
Conversation
…ips — PR 2/2 Family members can now opt into a trip's alerts from the dashboard, no Claude needed: - /trips gets a per-trip toggle (client component + server action behind the same signed-in + family-allowlist gates). The member id written is ALWAYS the session sub; opt-IN is guarded on the member's profile having a Pushover key (clear error pointing at /me instead of a silent no-op); applies to the trip's un-recorded days. - dynamodb-writes.setPlanAlertSubscription: the web's ONLY write into the shared trip partition — deliberately narrow (UpdateItem on exactly one attribute via ATOMIC set ADD/DELETE, so it can't race with or clobber MCP planner edits; boundary documented in the module). IAM already covers it (LeadingKeys USER#*), no CDK change. - Reader surfaces alert_subscribers per day (SS → sorted array; a JS Set can't cross the Server Component prop boundary). - Poller: dedupe dispatch by Pushover KEY (alert_routing. dedupe_resolved_by_key + weather-loop equivalent). The owner is an implicit recipient under "megan" and can now ALSO opt in under their sub via the toggle — same key must mean one push, not two. Applied to all three resolver dispatch sites + the weather fanout. Tests: atomic ADD/DELETE command shape, reader SS normalization, dedupe (first-id-wins, missing-key drop). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Per-trip "Get alerts" toggle on /trips (session-sub identity, Pushover-key guard, atomic set writes — the web's only, deliberately-narrow write into the shared partition), plus poller send-dedupe by Pushover key so the implicit owner + a web opt-in under their sub can't double-push.
🤖 Generated with Claude Code