-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: fuels dev
hangs after compilation errors
#3504
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This PR is published in NPM with version 0.0.0-pr-3504-20250102160454 |
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
Co-authored-by: Peter Smith <peter@blueoceancomputing.co.uk>
error(err.message); | ||
if (config) { | ||
await config.onFailure?.(config, <Error>err); |
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.
Why go from async
to sync
?
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.
It was always sync because onFailure
returns void
. ref
We could change the signature to be Promise<void> | void
in some other PR - it comes in handy to be able to pass async callbacks.
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.
Got it. I think we could then fix the return type (still in this PR) and keep it async
because the user may have an async
tear-down routine for these failure scenarios, and if we don't wait, things may be left dirty.
If we leave types aside for one second, we'd be doing something similar to what we did with the test utilities for asserting Fuel errors, although this case is much less convoluted. By considering it could always be async
and always await
ing for it, we cover both cases.
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 have reverted withConfigErrorHandler
to be async
again in 7c333c9, as well as all of the other related changes like this await
, and have created #3582 because all our event listeners are synchronous. I have included this onFailure
listener there as well. I think it's better to cover it all in one PR for that issue. Sounds good?
Coverage Report:
Changed Files:
|
fuels dev
hangs on generating types #1886Release notes
In this release, we:
fuels dev
would hang after a Sway compilation errorSummary
This PR fixes the issue where
fuels dev
would hang after a Sway compilation error. Thebuild
process was failing and the failure was caught, but thereject
callback that is called on failure was being called with an error code1
, which can't be rethrown later once thereject
's error is caught in atry/catch
- it has to be anError
object. After changing it to anError(forc exited with exit code ${code})
, I realized that the error handlers present in thosetry/catch
es weren't re-throwing the caught error. After adding a re-throw in them, I found out that the error was further being swallowed in thebin.ts
file. The bug was fixed upon changing that.Checklist