-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
chore!: wrap subscriptions in promise #2964
Conversation
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.
May be worth adding submitAndAwait
to the breaking changes (to be thorough):
// Before
this.operations.submitAndAwait({ encodedTransaction: '0x' })
// After
await this.operations.submitAndAwait({ encodedTransaction: '0x' })
LGTM though, nice one!
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.
@arboleya I updated the description. It's not that we'll have issues by implementing both #2936 and #2962 together but that my solution for #2936 was naive so I reverted it. I actually made it work locally and all the tests were passing but when it came to the CI it started failing because the CI machine is slower and I was doing some |
Coverage Report:
Changed Files:
|
Summary
I moved
FuelGraphqlSubcriber
instantiation to be async as a preparatory step for #2936. I tried introducing the solution for that issue in #2962, commit 8051113, but I wasn't happy with the solution so I reverted it and created this to give myself room to figure out a solution.This change is necessary for the usage of
submitAndAwait
endpoint because the transaction can fail when submitted, but the failure isn't manifested until a call to theFuelGraphqlSubscriber.next
method is done. With this async instantiation, the subscription can be made to fail before the actual subscription iterator is returned. I will add this failure handling in a subsequent PR that will tackle #2936, after I sync with thefuel-core
team. We currently aren't usingsubmitAndAwait
anywhere so it's not a problem to leave it unhandled as-is.Breaking Changes
Checklist