Fix notification routes and goal dedupe for #334 - #488
Conversation
|
Implementation approach:
Expected files are the notification entity and tests, OrbitDbContext and snapshot, NotificationUrls plus all inventoried producers and their tests, GoalDeadlineNotificationService and tests, two migration file sets, and the generated OpenAPI and architecture artifacts. I will not recreate the streak activation service removed by #331. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed the current implementation at 9e6a5a7; this scaffold contains no file changes relative to main.
- Implementation scaffold The commit establishes the PR branch only; the notification route, goal deduplication, migration, persisted destination, and test changes remain described in the PR body but are not implemented yet.
GPT Sol | 𝕏
|
Updated implementation approach after the 2026-08-23 ticket correction:
Expected changes remain limited to the named notification entity, persistence configuration and migrations, notification producers and predicates, their focused tests, and generated contract artifacts. The streak service will not be deleted or disabled. |
There was a problem hiding this comment.
Important
This implementation has a client rollout break and two migration data-safety failures that must be addressed before merge.
Reviewed changes Reviewed the implementation added since the prior Pullfrog review at 9e6a5a7.
- Centralized destinations: Replaced notification URL literals with
NotificationUrlsand removed nonexistent social destinations. - Separated deduplication from navigation: Added nullable
DedupeKeypersistence and a filtered unique index for goal deadline notifications. - Rewrote progress destinations: Routed new goal and streak notifications to
/progressand migrated legacy goal and streak rows. - Expanded safeguards: Added the domain URL guard plus producer, migration-shape, deduplication, and route-constant tests.
GPT Sol | 𝕏
|
Review follow-up for
Post-fix verification remains 0 build errors and 5,801 passing tests. |
There was a problem hiding this comment.
ℹ️ No new issues in the incremental delta. The existing client rollout thread remains open, so this review does not approve the PR.
Reviewed changes Reviewed 3f1fcca, which hardened the migration behavior added since the prior Pullfrog review.
- Normalized legacy duplicates: Ranked goal deadline rows deterministically, retained one canonical dedupe key per URL, and assigned stable ID-suffixed keys to additional rows across batches.
- Preserved rollback provenance: Tagged only migrated streak rows so the reverse migration no longer rewrites unrelated
/progressnotifications. - Strengthened migration checks: Expanded migration-shape assertions for duplicate normalization, suffix restoration, and streak provenance markers.
GPT Sol | 𝕏
…cation-routes # Conflicts: # architecture.html # architecture.json
…cation-routes # Conflicts: # architecture.html
|
@pullfrog review |
There was a problem hiding this comment.
Important
Native social and accountability pushes still resolve null to the home route, so the no-destination behavior is not implemented on Android.
Reviewed changes Reviewed notification destination handling, goal deadline deduplication, both data migrations, client contract compatibility, and focused coverage at b88c3f0.
- Destination inventory: Centralizes valid notification routes and removes nonexistent social destinations from persisted notifications.
- Deadline idempotency: Separates navigation from goal deadline deduplication with
DedupeKey, a filtered unique index, and conflict-aware push ordering. - Data migration: Backfills legacy goal keys, normalizes historical duplicates, and rewrites only proven streak routes with reversible provenance.
- Cross-repo behavior: Keeps API DTOs unchanged and verifies how web and Android clients validate and navigate notification URLs.
- Coverage: Updates producer, domain, scheduler, dedupe, route-constant, and migration-operation tests.
GPT Sol | 𝕏
|
Round 2 implementation approach:\n\n1. Change push payload construction so a null destination omits the url key. Apply this to the batched FCM path, its per subscription fallback, and Web Push so every transport preserves the same destinationless meaning.\n2. Keep nonnull payloads unchanged and cover null and real destinations field by field at payload construction boundaries.\n3. Confirm the mobile consumer tolerates a missing key by reading its notification response handler, then record that evidence in this PR.\n4. Run the focused infrastructure tests, commit immediately when they pass, then run the full build and test sequence, push this branch, and monitor PR #488 checks.\n\nThe mobile handler at apps/mobile/hooks/use-push-notifications.ts reads content data url through optional access and only calls router.push when the value is a valid string, so a missing key is safe and needs no client change. |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes Reviewed 88ee925 and 45789e0, which corrected push payload construction and refreshed generated architecture artifacts since the prior Pullfrog review at b88c3f0.
- Preserved FCM destinationlessness: Routed both batch and fallback sends through one message builder that omits
data.urlwhen the producer passes null while preserving explicit routes. - Preserved Web Push destinationlessness: Replaced anonymous-object serialization with conditional payload construction so null destinations omit the
urlkey. - Strengthened payload coverage: Added exact field-level tests for null and
/progressdestinations across both transports, and confirmed the mobile listener ignores an absent key. - Regenerated architecture artifacts: Updated the architecture map with the push-service test references and reproduced the checked-in files cleanly with
node tools/arch-map.mjs.
GPT Sol | 𝕏
|




Summary
Closes thomasluizon/orbit-tickets#334
Testing
Client compatibility
The mobile notification response handler at apps/mobile/hooks/use-push-notifications.ts reads content data url through optional access and navigates only when the value is a string accepted by isViewableNotificationUrl. A missing url key therefore produces no navigation and does not throw. No client change is required for the missing key.
Rollout decision
The persisted streak rewrite runs in this release, as Thomas decided on 2026-08-22. Builds that lack /progress are covered by the minimum supported version rollout in #203. Historic streak freeze rows are accepted as a short, bounded exposure.
Both migrations update at most 1,000 rows per batch and emit one row count. Their Down paths restore values before removing schema state.
Assumptions