You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Promise.resolve or Promise.reject in 99.99% of case signals bad pattern. Same with new Promise() constructs (if we convert async non promise construct, it's usually better to rely on existing generic utility that does that)
We have many such occurrences in our code, as it predates async/await, and BbPromise.try was not explored as an alternative.
Proposed solution
Replace any BbPromise.resolve and Promise.resolve usage with direct value usage
Replace any BbPromise.reject and Promise.reject usage with direct exception throws
If possible replace any new Promise and new BbPromise constructs, so existing utils are used instead (e.g. stream-promise for converting stream to promise). For cases where promise construction is confirmed to be valid, ensure it's a new Promise (and not new BbPromise) and report such occurrence in this issue.
The text was updated successfully, but these errors were encountered:
Use case description
Should be addressed after #8369
Paves path to #7171
Using
Promise.resolve
orPromise.reject
in 99.99% of case signals bad pattern. Same withnew Promise()
constructs (if we convert async non promise construct, it's usually better to rely on existing generic utility that does that)We have many such occurrences in our code, as it predates async/await, and
BbPromise.try
was not explored as an alternative.Proposed solution
BbPromise.resolve
andPromise.resolve
usage with direct value usageBbPromise.reject
andPromise.reject
usage with direct exception throwsnew Promise
andnew BbPromise
constructs, so existing utils are used instead (e.g.stream-promise
for converting stream to promise). For cases where promise construction is confirmed to be valid, ensure it's anew Promise
(and notnew BbPromise
) and report such occurrence in this issue.The text was updated successfully, but these errors were encountered: