Skip to content

Conversation

microbit-robert
Copy link
Contributor

Only reconnect serial session on tab change if consumer is already listening.

Only reconnect serial session on tab change if consumer is already
listening.
Comment on lines +152 to +153
if (--this.addedListeners[type] <= 0) {
this.addedListeners[type] = 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could better manage our own callers as well. Continually clicking disconnect got us into negative numbers.

Comment on lines +104 to +106
if (this.disconnectPromise) {
await this.disconnectPromise;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed I'll replace this with a generic async state change queue.

@microbit-matt-hillsdon microbit-matt-hillsdon merged commit bff05d7 into main Jul 25, 2024
@microbit-matt-hillsdon microbit-matt-hillsdon deleted the robust-radio branch July 25, 2024 15:46
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.

2 participants