feat(ProofOfHeart-frontend): performance-uselivecampaignfunding-polls-every-n - #705
Conversation
|
@Caneryy 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! 🚀 |
|
Auto-review failed (API error). Leaving PR for human review. |
|
@davidmaronio review and merge please |
|
the live-campaign-funding polling refactor looks clean and doesn't introduce any lint hits of its own, the lint failure is stale, it's flagging warnings in files you don't touch because the branch predates their fixes on main. rebase onto main and lint clears; after that the only red is our shared broken Playwright e2e. |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Auto-review failed (API error). Leaving PR for human review. |
1 similar comment
|
Auto-review failed (API error). Leaving PR for human review. |
|
All checks passed now. please review and merge @davidmaronio |
davidmaronio
left a comment
There was a problem hiding this comment.
nice migration: the cursor-based subscribeContributionMadeEvents with backoff on errors, immediate re-poll on full batches, dedup by event id, and the visibility gate in the hook are all solid, and the tests cover the streaming loop and unsubscribe path. CI is green and the branch is clean.
two small notes:
- src/lib/sorobanEvents.ts:145: the default idle interval drops from the previous 5s poll to 2s, which increases rpc load when nothing is happening. the env override still works, but consider keeping 5s as the idle default since this PR is billed as a performance win.
- heads up that #849 migrates this same hook onto the shared
eventSubscriber. whichever lands second will need a rebase; flagging so the authors can coordinate.
Closes #571
Summary
Replaces
useLiveCampaignFundingpolling with Sorobancontribution_madeevent streaming via the existingsorobanEvents.tsinfrastructure.Changes
useLiveCampaignFunding— no moresetIntervalpolling; live amount updates from streamed events, reconciled onget_campaignrefetchuseCampaignContributionEvents— subscribes tocontribution_madewith cursor-based streaming, deduplication by event id, pauses when tab is hiddensorobanEvents.ts— extended withsubscribeContributionMadeEventsand contribution amount helpersRebase note (per @davidmaronio review)
Rebased onto latest
mainto clear stale lint failures from files this PR does not touch. Lint and format checks now pass on the rebased branch.Acceptance criteria
sorobanEvents.tsinfrastructureget_campaignrefetch still worksmainTest plan
npm run lint— 0 errorsnpm run format:check— passessorobanEvents.test.tsunit tests passKnown CI status
Playwright E2E remains red — confirmed upstream shared issue, not introduced by this PR (@davidmaronio).