-
Notifications
You must be signed in to change notification settings - Fork 274
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
BLO-887 fix: add tab #1898
BLO-887 fix: add tab #1898
Conversation
Kudos, SonarCloud Quality Gate passed! |
|
||
for (const tab of tabs) { | ||
try { | ||
tab.port.postMessage(message) |
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.
no await?
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.
Surprisingly turns out port.postMessage
is not a Promise, so it was throwing exception in previous implementation before reaching Promise.allSettled(...). Actually should handle the error here and disconnect the port - it's usually an 'attempt to use disconnected port object' error
await Promise.allSettled(promises) | ||
for (const tab of tabs) { | ||
try { | ||
tab.port.postMessage(message) |
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.
same, does it catch errors from within the promise without await?
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.
Same
Changes