fix(forge-stream): add is_claimable to StreamStatus and clarify is_ac…#297
Merged
Austinaminu2 merged 1 commit intoAustinaminu2:mainfrom Mar 30, 2026
Merged
Conversation
…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
|
@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! 🚀 |
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.
What does this PR do?
get_stream_status()correctly marks a finished stream withis_active = false,but UIs that treat
is_active = falseas "nothing to claim" would silently skipwithdrawable tokens. There was no field to distinguish "not actively streaming"
from "nothing left to withdraw".
Fix: add
is_claimable: booltoStreamStatus(true whenwithdrawable > 0)and clarify the
is_activesemantics in the doc comment and README.Related issue
Testing done
Added
test_finished_stream_is_claimable_before_withdrawal: creates a stream,advances past
end_timewithout withdrawing, and asserts:is_active = falseis_finished = trueis_claimable = truewithdrawable == total streamedChecklist
cargo fmt(or equivalent formatter)cargo clippy(or equivalent linter)Closes #243