feat(backend): notify on subscription charge + fix realtime room-broadcast tests - #1120
Merged
Akanimoh12 merged 1 commit intoJul 25, 2026
Conversation
…cast tests - Akanimoh12#965: add a `subscription_charged` notification type, gated by a new per-user `subscriptionCharged` preference (default enabled), and fire it from the indexer's sub_exec projection when a charge is genuinely new (event-log gated, so replays never duplicate it). - Akanimoh12#957: fix gateway.test.ts, which was signing tokens with a stale `sub` claim and asserting a stale error message — both leftovers from a prior auth/error-shape change that left the auth-handshake tests silently broken (one timing out, one failing). Add missing room-broadcast coverage for tip.created and notification.created, which had no tests. - Akanimoh12#961 (POST /notifications/read-all) and Akanimoh12#962 (notification creation service) were already fully implemented and tested on this branch by prior work; verified against the Definition of Done and left as-is. Closes Akanimoh12#961, Akanimoh12#962, Akanimoh12#965, Akanimoh12#957
|
@DeborahOlaboye Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Akanimoh12
merged commit Jul 25, 2026
bdd58f2
into
Akanimoh12:test-implement-drips
4 of 5 checks passed
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.
Summary
Resolves four assigned backend issues:
subscription_chargednotification type, gated by a new per-usersubscriptionChargedpreference (NotificationPreferencemodel + migration, defaulting to enabled). Wired into the indexer'ssub_execprojection (projectSubscriptionCharged), notifying the creator when a charge lands. Guarded by the event-log'sisNewEventflag so replaying the same ledgers never re-notifies.gateway.test.tshad two silently-broken tests: one signed JWTs with a stalesubclaim instead ofuserId(so the auth handshake never actually authenticated as the expected user, hanging the "delivers balance.updated" test until timeout), and one asserted a stale{ message: 'Forbidden' }shape instead of the current{ code: 'FORBIDDEN' }. Fixed both. Also added missing room-broadcast coverage fortip.created(creator room) andnotification.created(user room), which had zero test coverage before this.POST /notifications/read-all. Already fully implemented and tested ontest-implement-drips(route, controller, service, and tests all present). Verified against the issue's acceptance criteria and left as-is.createNotificationalready exists innotifications.service.tswith full test coverage. Verified and left as-is.Why one PR for four issues
All four are small, tightly-scoped, same-module (
backend/src/modules/notifications/,backend/src/realtime/) issues from the same wave assignment, so they're bundled together rather than opening four near-empty PRs.Test plan
npx vitest run src/modules/notifications/ src/realtime/ src/indexer/projections.test.ts— all pass (16 realtime + 33 notifications + 41 projections)npx eslinton every touched file — 0 errorsnpx tsc --noEmit— no new errors introduced (two pre-existing, unrelated errors remain insrc/modules/credit/credit.service.tsandsrc/modules/tips/tips.test.ts, untouched by this PR)tests/*.test.ts) require a local Postgres/Redis I didn't have running; unaffected by this change (same caveat noted in the priorfeat/realtime-notifications-954-955-956-959PR)Closes #965
Closes #957
Closes #961
Closes #962