-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(casting): dont crash on bad capdata #8562
Conversation
87aa97a
to
eca302f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like how self-contained it is. LGTM!
Please consider un-templatizing the ValueFollowerBase, but whether you choose to is not a blocker.
packages/casting/src/types.js
Outdated
@@ -40,14 +40,18 @@ export {}; | |||
*/ | |||
|
|||
/** | |||
* @see {ChangeFollower} | |||
* @template T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The base no longer needs to be a template.
* @template T |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good catch, removed
packages/casting/src/types.js
Outdated
/** | ||
* @see {ChangeFollower} | ||
* @template T | ||
* @typedef {ValueFollowerBase<T> & ({ value: T } | { value: undefined, error: any })} ValueFollowerElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @typedef {ValueFollowerBase<T> & ({ value: T } | { value: undefined, error: any })} ValueFollowerElement | |
* @typedef {ValueFollowerBase & ({ value: T } | { value: undefined, error: any })} ValueFollowerElement |
eca302f
to
8f4ba3a
Compare
fix(casting): dont crash on bad capdata
refs Agoric/ui-kit#57
refs #8579
Explanation in the comment thread of the issue. TL;DR - The follower was crashing silently after hitting bad capdata. This change makes it so that instead it surfaces an
error
instead of avalue
in that case, and keeps yielding more values.Added a unit test to ensure that it properly surfaces the error and can keep yielding more values afterwards.