-
-
Notifications
You must be signed in to change notification settings - Fork 236
chore(js): Remove live = 'rejectOnError' option
#2971
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
base: szokeasaurusrex/no-release-bundle-uploads
Are you sure you want to change the base?
chore(js): Remove live = 'rejectOnError' option
#2971
Conversation
### Description We added the `live = 'rejectOnError'` option in #2605 with the intention to make the behavior provided by setting `live = 'rejectOnError'` the default behavior of setting `live = true` in the next major. ### Issues - Resolves #2606 - Resolves [CLI-138](https://linear.app/getsentry/issue/CLI-138/v3-fix-js-interface-execute-promise-resolve-values)
abf71f3 to
6b12318
Compare
### Description We added the `live = 'rejectOnError'` option in #2605 with the intention to make the behavior provided by setting `live = 'rejectOnError'` the default behavior of setting `live = true` in the next major. ### Issues - Resolves #2606 - Resolves [CLI-138](https://linear.app/getsentry/issue/CLI-138/v3-fix-js-interface-execute-promise-resolve-values)
6b12318 to
40b77a1
Compare
Lms24
left a comment
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, thanks! (cc @JPeer264 since we just talked about this)
### Description We added the `live = 'rejectOnError'` option in #2605 with the intention to make the behavior provided by setting `live = 'rejectOnError'` the default behavior of setting `live = true` in the next major. ### Issues - Resolves #2606 - Resolves [CLI-138](https://linear.app/getsentry/issue/CLI-138/v3-fix-js-interface-execute-promise-resolve-values)
40b77a1 to
bd678cf
Compare
3d01060 to
002c166
Compare
| // TODO (v3): Clean this up and always resolve a string (or change the type definition) | ||
| // @ts-expect-error - see comment above | ||
| resolve(); | ||
| reject(new Error(`Command ${args.join(' ')} failed with exit code ${exitCode}`)); |
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.
Bug: Missing else causes reject after successful resolve
The exit handler unconditionally calls reject() after conditionally calling resolve() for zero exit codes. When exitCode === 0, both resolve('success (live mode)') and reject(new Error(...)) execute sequentially. While promises only settle once, this creates an unhandled rejection and indicates incorrect control flow logic. An else clause or return statement is needed to prevent rejection after successful resolution.
| * | ||
| * @param {string} release Unique name of the release. | ||
| * @param {SentryCliUploadSourceMapsOptions & {live?: boolean | 'rejectOnError'}} options Options to configure the source map upload. | ||
| * @param {SentryCliUploadSourceMapsOptions} options Options to configure the source map upload. |
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.
@szokeasaurusrex Here the live option is entirely removed, but in types.ts the live option is just adapted. What is now true?
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.
Yes, exactly, this removal is intentional. For sourcemaps upload, we always use live = true, and there is no way to override this (this is actually what we had prior to introducing the 'rejectOnError' option; we only made live configurable here to allow us to use 'rejectOnError').

Description
We added the
live = 'rejectOnError'option in #2605 with the intention to make the behavior provided by settinglive = 'rejectOnError'the default behavior of settinglive = truein the next major.Issues
executepromise resolve values #2606