Implements four backend realtime/withdrawals issues on test-implement-drips. - #1121
Merged
Conversation
…thdrawal submit endpoint Implements four backend issues on test-implement-drips: - Realtime: emit leaderboard.updated to a public `leaderboard` room whenever a confirmed tip changes a creator's rank (Akanimoh12#952). - Realtime: attach the Socket.IO Redis adapter (gated by REALTIME_REDIS_ADAPTER_ENABLED) so rooms are shared across horizontally scaled instances (Akanimoh12#948). - Realtime: strengthen per-creator room test coverage with targeted-delivery assertions; the room join/auth implementation already existed (Akanimoh12#949). - Withdrawals: add POST /withdrawals/submit to broadcast a wallet-signed withdrawal transaction and record it as a PENDING withdrawal, idempotent by txHash (Akanimoh12#940). Also fixes a pre-existing bug in tips.test.ts (undefined mockCreateNotification reference / mockUserFindUnique typo) that was crashing the entire test file before any test could run. Closes Akanimoh12#952 Closes Akanimoh12#948 Closes Akanimoh12#949 Closes Akanimoh12#940 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
@JONAH-6 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! 🚀 |
Owner
|
Great work |
Akanimoh12
merged commit Jul 26, 2026
21c641e
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
Branch feat/realtime-leaderboard-redis-withdrawal-submit-940-948-949-952 (off
test-implement-drips) resolves all 4 issues:
room whenever a confirmed tip changes a creator's rank (wired into the existing
tip-confirmation flow, best-effort like the existing balance.updated).
duplicated ioredis connections) so rooms are shared across horizontally scaled
instances. Gated by a new REALTIME_REDIS_ADAPTER_ENABLED env var (default true;
disabled in tests).
added stronger tests proving targeted delivery (not just "no error thrown").
Soroban RPC and records a PENDING withdrawal, idempotent by txHash.
Also fixed a pre-existing bug in tips.test.ts (an undefined mockCreateNotification
reference and a mockUserFindUnique typo) that was crashing the entire test file
before any test in it could run — necessary to verify my own change and to unblock
the suite.
Verified: npm run typecheck and npm run lint are clean of anything I touched (only a
pre-existing, unrelated credit.service.ts bug remains). npm run test — my new/fixed
tests all pass (21 new tests + 37 recovered tests); no regressions versus baseline.
PR body to use
Implements four backend realtime/withdrawals issues on
test-implement-drips.What's done
leaderboard.updatedis emitted to a publicleaderboardroom whenever a confirmed tip changes a creator's rank. Clientssubscribe with
subscribe:leaderboard/unsubscribe:leaderboard.initRealtimeattaches@socket.io/redis-adapter(two duplicatedioredisconnections) so roomsare shared across multiple backend instances. Controlled by
REALTIME_REDIS_ADAPTER_ENABLED(new env var, documented in.env.exampleand
src/config/env.ts; defaults totrue, disabled in the test suite).proving
tip.created-style events are only delivered to sockets thatsubscribed to that creator's room.
POST /withdrawals/submit: accepts a wallet-signed transaction XDR,broadcasts it via Soroban RPC, and records a
PENDINGwithdrawal row(idempotent by
txHash). Validated with Zod; errors useAppError.Also fixed
tips.test.tshad a pre-existing bug (undefinedmockCreateNotification,a
mockUserFindUniquetypo) that crashed the entire file before any testcould run. Fixed so the suite — and the new leaderboard test in it — can
actually execute.
Testing
npm run typecheck— clean (no new errors)npm run lint— clean (no new warnings/errors)npm run test— all new/fixed tests pass; no regressionsCloses #952
Closes #948
Closes #949
Closes #940