Skip to content

feat: Add merge_streams feature (#672) - #922

Open
ositaemmanuel653-netizen wants to merge 1 commit into
ritik4ever:mainfrom
ositaemmanuel653-netizen:feature/merge-streams
Open

feat: Add merge_streams feature (#672)#922
ositaemmanuel653-netizen wants to merge 1 commit into
ritik4ever:mainfrom
ositaemmanuel653-netizen:feature/merge-streams

Conversation

@ositaemmanuel653-netizen

Copy link
Copy Markdown

Commit Type

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (formatting, etc.)
  • refactor: A code change that neither fixes a bug nor adds a feature
  • perf: A code change that improves performance
  • test: Adding missing or correcting existing tests
  • build: Changes affecting the build system or external dependencies
  • ci: Changes to CI/CD configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit

Breaking change? (If yes, add BREAKING CHANGE in the commit footer)

  • Yes — this contains a breaking change
  • No

What changed

  • Added merge_streams(stream_id_a, stream_id_b, sender) -> u64 to merge two existing streams into a single stream.
  • Restricted stream merging to streams that belong to the same sender and have the same recipient.
  • The merged stream's total amount is calculated from the remaining amounts of both source streams.
  • The merged stream duration is based on the maximum remaining duration of the two source streams.
  • Both source streams are marked as completed after a successful merge.
  • Added a StreamsMerged event to record successful stream merges.
  • Added/updated tests covering valid merges and validation of incompatible streams.

Testing done

  • Added tests covering merging streams with the same sender and recipient.
  • Verified that the merged stream contains the correct combined remaining amount.
  • Verified that the merged stream uses the maximum remaining duration.
  • Verified that both source streams are marked as completed after merging.
  • Verified that streams with different senders or recipients cannot be merged.
  • Ran the relevant test suite successfully.

Related issues

Closes #672

Checklist

  • I used the correct commit type (see above) for the squashed commit message.
  • I kept the change focused on the related issue.
  • I added or updated tests where useful.
  • I updated documentation where behavior changed.
  • I verified the app still builds or explained why verification was skipped.
  • My commits follow [Conventional Commits](https://www.conventionalcommits.org/) (enforced by commitlint).

@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the ritik4ever's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@ositaemmanuel653-netizen 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

@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 128241e9-d482-43bd-86c9-d66f53010420


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.

@ositaemmanuel653-netizen

Copy link
Copy Markdown
Author

@ritik4ever

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.

[FEATURE] Add stream merger: combine two streams to one recipient

1 participant