Skip to content
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

Merged
merged 1 commit into from
Mar 10, 2023
Merged

BLO-887 fix: add tab #1898

merged 1 commit into from
Mar 10, 2023

Conversation

simonheys
Copy link
Collaborator

@simonheys simonheys commented Mar 10, 2023

Changes

  • add tab so it can receive messages

@simonheys simonheys changed the base branch from develop to main March 10, 2023 08:46
@github-actions
Copy link

Builds for local testing

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
2.1% 2.1% Duplication


for (const tab of tabs) {
try {
tab.port.postMessage(message)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no await?

Copy link
Collaborator Author

@simonheys simonheys Mar 10, 2023

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)
Copy link
Collaborator

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@simonheys simonheys marked this pull request as ready for review March 10, 2023 10:17
@simonheys simonheys requested a review from dhruvkelawala March 10, 2023 10:18
@simonheys simonheys changed the title fix: add tab BLO-887 fix: add tab Mar 10, 2023
@simonheys simonheys merged commit 39d0444 into main Mar 10, 2023
@simonheys simonheys deleted the hotfix/pre-authorized branch March 10, 2023 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants