fix(streams): parseStreamInfo must not throw on a malformed flags value (#617) - #688
Open
ZacLou wants to merge 3 commits into
Open
fix(streams): parseStreamInfo must not throw on a malformed flags value (#617)#688ZacLou wants to merge 3 commits into
ZacLou wants to merge 3 commits into
Conversation
…tate (conduit-protocol#630) Adds a lightweight CircuitBreaker that tracks failures per scope (e.g. RPC URL). After a configurable threshold of consecutive failures, the circuit opens and fast-fails subsequent calls with CircuitOpenError. After a cooldown, the circuit transitions to half-open and allows a single probe call. - New src/circuit-breaker.ts: withCircuitBreaker, getCircuitState, CircuitOpenError, configureCircuitBreaker. - createRpcServer now wraps every proxied method call through withCircuitBreaker scoped by rpcUrl. - Exports added to src/index.ts. - Unit tests cover closed/open/half-open states, success-reset, and CircuitOpenError scope propagation.
…ue (conduit-protocol#617) When the contract returns a flags entry that is present but not a u32 ScVal, scValToU32 throws. Wrap the call in try/catch so parseStreamInfo defaults to 0 instead of letting the unhandled exception propagate. - Change const flags = m['flags'] ? scValToU32(...) : 0 to a guarded try/catch block that silently falls back to 0 on type mismatch. - Add unit test: u64 ScVal passed as flags → all flag booleans false.
Contributor
Author
|
Fixed the CI failures:
Local |
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.
Closes #617
When the contract returns a
flagsentry that is present but not au32ScVal,scValToU32throws an unhandledError. This change wraps the call intry/catchsoparseStreamInfodefaults to0instead of letting the exception propagate.Changes
scValToU32(m["flags"])withtry/catch; malformedflags→0.u64ScVal passed asflagsresults in all flag booleans (paused,cancelled,clawbackEnabled) beingfalse.Checklist
flagsno longer throws.