-
Notifications
You must be signed in to change notification settings - Fork 206
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
Match notifier semantics to async iterables #1332
Conversation
It was added because the getStateSince function used to have a synchronous mode that I removed for consistency but I wasn't sure if it was still needed. Good riddance. |
Ready for review |
Test failed in cosmic-swingset. |
This would seem to be a very deterministic error. Why would it work for me under |
Usually because updater is a presence and we forgot to add E(). |
Did you run |
I did. It passed. |
So, now The error is on agoric-sdk/packages/zoe/src/contractFacet.js Line 373 in 05eaa73
Rename resolve: to fulfill: , redo yarn build in Zoe, and the problem goes away!
The next thing to do is to create a compatible branch of |
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.
LGTM, modulo the single contractFacet change I mentioned.
I made this change temporarily legacy supporting enough, such that the current dapp-encouragement works under CI as is. Once all clients are upgraded to the new API, I would then like to remove the transient legacy support in notifier.js. @katelynsills what is this trick? What other notifier clients would we need to upgrade before I can remove the legacy support in notifier.js? Since removing this support is a compat break, should I bump some version number at that time? |
Great plan. I always appreciate compatibility with a deprecation plan.
It's adding
Many of the dapps (search for
The version number will be automatically bumped upon next release if you add an exclamation point before the colon of your Conventional Commit message, like |
This new semantics and representation derive from conversations with @dtribble and @Chris-Hibbert . It is also influenced by @kriskowal 's GTOR -- General Theory of Reactivity. It should be a better basis for reconstructing #962 soundly, and for eventually forming working remote presences of notifiers and async iterables.
There is a key difference on starting, and another key difference on terminating.
On starting, if no initialState argument is provided, then the notifier starts with no initial state. It's initial state will be set by the first update. I also removed the
getCurrentState
synchronous access, as that conflicts with a delayed initial state. No one could explain why it was added.On ending, two kinds of termination are supported, successfully with a last state value, and erroneously with a rejection reason.
With both of these changes, we can adapt both ways between notifiers and async iterators, while losing only the fidelity that is the point of notifiers --- the dropping of less recent states.