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

[expo] Add auto reconnection in DevToolsPluginClient #27704

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Mar 15, 2024

Why

fixes expo/dev-plugins#22

How

  • introduce a WebSocket compatible WebSocketWithReconnect that will retry connection and keep sending messages in a queue when connection lost.
  • rather than throwing exception from sending message, just show a softer warning if needed.

Test Plan

added unit tests

  • should act as a WebSocket
  • should reconnect when the connection is lost
  • should keep sending messages when retrying connection
  • should throw errors if exceeds max retries

Checklist

@expo-bot expo-bot added the bot: passed checks ExpoBot has nothing to complain about label Mar 15, 2024
@Kudo Kudo marked this pull request as ready for review March 15, 2024 18:08
Base automatically changed from @kudo/dev-plugins/multiplexing to main March 18, 2024 18:58
@Kudo Kudo force-pushed the @kudo/dev-plugins/auto-reconnect branch from 53dec13 to 5263d0e Compare March 18, 2024 19:20
@Kudo Kudo merged commit 77f9440 into main Mar 19, 2024
11 checks passed
@Kudo Kudo deleted the @kudo/dev-plugins/auto-reconnect branch March 19, 2024 01:57
Kudo added a commit that referenced this pull request Mar 19, 2024
# Why

fixes expo/dev-plugins#22

# How

- introduce a WebSocket compatible `WebSocketWithReconnect` that will
retry connection and keep sending messages in a queue when connection
lost.
- rather than throwing exception from sending message, just show a
softer warning if needed.

(cherry picked from commit 77f9440)
@Kudo Kudo added the published Changes from the PR have been published to npm label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint compatible bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error : Unable to send message in a disconnected state.
3 participants