Skip to content

fix(forge-stream): add is_claimable to StreamStatus and clarify is_ac…#297

Merged
Austinaminu2 merged 1 commit intoAustinaminu2:mainfrom
zeekman:fix/243-stream-status-is-claimable
Mar 30, 2026
Merged

fix(forge-stream): add is_claimable to StreamStatus and clarify is_ac…#297
Austinaminu2 merged 1 commit intoAustinaminu2:mainfrom
zeekman:fix/243-stream-status-is-claimable

Conversation

@zeekman
Copy link
Copy Markdown
Contributor

@zeekman zeekman commented Mar 30, 2026

What does this PR do?

get_stream_status() correctly marks a finished stream with is_active = false,
but UIs that treat is_active = false as "nothing to claim" would silently skip
withdrawable tokens. There was no field to distinguish "not actively streaming"
from "nothing left to withdraw".

Fix: add is_claimable: bool to StreamStatus (true when withdrawable > 0)
and clarify the is_active semantics in the doc comment and README.

Related issue

Testing done

Added test_finished_stream_is_claimable_before_withdrawal: creates a stream,
advances past end_time without withdrawing, and asserts:

  • is_active = false
  • is_finished = true
  • is_claimable = true
  • withdrawable == total streamed

Checklist

  • I have run cargo fmt (or equivalent formatter)
  • I have run cargo clippy (or equivalent linter)
  • All tests pass locally
  • I have labeled this PR with 'good first issue' or 'dx' where applicable.

Closes #243

…tive semantics

Fixes Austinaminu2#243. is_active = false on a finished stream could mislead UIs into
thinking nothing is withdrawable. Changes:

- Add is_claimable: bool field to StreamStatus (withdrawable > 0)
- Populate is_claimable in get_stream_status()
- Update get_stream_status() doc comment to document that is_active = false
  does not imply withdrawable = 0, and recommend checking is_claimable
- Add test_finished_stream_is_claimable_before_withdrawal asserting a
  finished stream has is_active=false, is_finished=true, is_claimable=true,
  and withdrawable == total
- Document the is_active vs is_claimable distinction in README
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 30, 2026

@zeekman 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

@Austinaminu2 Austinaminu2 merged commit a812b4a into Austinaminu2:main Mar 30, 2026
1 check failed
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.

forge-stream withdraw() does not check if stream has finished — is_active flag in get_stream_status() can be misleading

2 participants