Skip to content

feat(indexer): wire stream handlers to persistence#81

Open
GreatShinro wants to merge 2 commits into
Fundable-Protocol:devfrom
GreatShinro:stream-persistence-wiring
Open

feat(indexer): wire stream handlers to persistence#81
GreatShinro wants to merge 2 commits into
Fundable-Protocol:devfrom
GreatShinro:stream-persistence-wiring

Conversation

@GreatShinro

Copy link
Copy Markdown

Stream persistence wiring PR

Summary

This PR wires the streams indexer handlers to a persistence layer so stream lifecycle events are no longer only validated and logged.

What changed

  • Added a stream write service/repository layer for:
    • stream creation
    • funding updates
    • withdrawal action recording
    • cancel action recording
  • Connected stream handlers for created, funded, withdrawal, and cancel events to persist durable state.
  • Added regression tests covering:
    • create flow
    • fund flow
    • withdraw flow
    • cancel flow
    • duplicate replay handling
    • missing stream cases

Notes

  • Duplicate event replays are handled idempotently so amounts are not double-counted.
  • The implementation uses string-based bigint-safe amount handling to avoid floating-point precision issues.

Validation

  • Stream handler tests pass locally:
    • 27 tests passed

Closes #52

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@GreatShinro, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8db3ce24-564a-452d-9288-a697b4d54fb4

📥 Commits

Reviewing files that changed from the base of the PR and between 50fba8e and dc67a5f.

📒 Files selected for processing (7)
  • indexer/streams/src/db/repository.ts
  • indexer/streams/src/handlers/stream-cancel.handler.ts
  • indexer/streams/src/handlers/stream-funded.handler.ts
  • indexer/streams/src/handlers/stream-handlers.test.ts
  • indexer/streams/src/handlers/stream-withdrawal.handler.ts
  • indexer/streams/src/handlers/streamCreated.test.ts
  • indexer/streams/src/handlers/streamCreated.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@drips-wave

drips-wave Bot commented Jul 23, 2026

Copy link
Copy Markdown

@GreatShinro 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! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire stream event handlers to persistence

1 participant