Skip to content

fix(streaming): resolve panics, add pause guards, and delegate events - #642

Merged
Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
brightfootlimited-collab:fix/467-468-469-cleanup-stream-pause-guards-delegate-events
Aug 27, 2026
Merged

fix(streaming): resolve panics, add pause guards, and delegate events#642
Austinaminu2 merged 2 commits into
FlowwStar:mainfrom
brightfootlimited-collab:fix/467-468-469-cleanup-stream-pause-guards-delegate-events

Conversation

@brightfootlimited-collab

Copy link
Copy Markdown
Contributor

Summary Fixes three related issues in contracts/streaming/src/lib.rs where public state-changing functions were inconsistent with the rest of the contract. --- ### Closes #467 — Convert \cleanup_stream()\ panics to \Result\ return type - Replaced .unwrap()\ panics in \get_archived_sent_streams\ and \get_archived_received_streams\ paginators with safe \if let\ guards - Added \StreamCleanedUpEvent\ struct following the existing event pattern - \cleanup_stream()\ now emits the event and returns \Ok(()), making it consistent with all sibling functions ### Closes #468 — Add \

equire_not_paused\ guard to \update_stream_metadata()\ - \update_stream_metadata()\ was the only state-changing function that allowed writes while the contract was paused - Added \Self::require_not_paused(&env)?\ at the top of the function - Added \ est_pause_blocks_update_stream_metadata\ to \ est_features.rs\ to confirm enforcement ### Closes #469 — Add pause guard and events to \set_delegate()\ /
emove_delegate()\ - Both functions now call
equire_not_paused(&env)\ at entry - Added \DelegateSetEvent\ and \DelegateRemovedEvent\ structs - Both functions now publish their respective events, matching the pattern of every other state-changing function in the contract --- ## Testing - Pre-commit hook (
ustfmt --check) passes cleanly - \ est_pause_blocks_update_stream_metadata\ added for #468 - Existing cleanup, delegate, and pause tests continue to pass

…ents FlowwStar#467 - Convert cleanup_stream() panics to Result return type - Replace .unwrap() panics in get_archived_sent/received_streams paginators with safe if-let guards - Add StreamCleanedUpEvent struct and emit it from cleanup_stream() - Add missing Ok(()) so the function compiles and returns correctly FlowwStar#468 - Add require_not_paused guard to update_stream_metadata() - Metadata could previously be mutated while the contract was paused; now matches the guard present on every other state-changing function - Add test_pause_blocks_update_stream_metadata to confirm enforcement FlowwStar#469 - Add pause guard and events to set_delegate() / remove_delegate() - Both functions now call require_not_paused(&env) at entry - Add DelegateSetEvent and DelegateRemovedEvent structs - Both functions now publish their respective events, matching the pattern of every other state-changing function in the contract Closes FlowwStar#467 Closes FlowwStar#468 Closes FlowwStar#469
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@brightfootlimited-collab 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 0041b03 into FlowwStar:main Aug 27, 2026
0 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants