[@expo/cli] Close development session when CLI is stopped #17170
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a rewrite of expo/expo-cli#4317 for the new CLI.
Why
Development Sessions shown in Expo Go can be "stale" (saying that they show up in the app when the Expo CLI session has been closed) for up to 3 minutes.
How
Expo CLI dev sessions can feel more up-to-date by calling
/notify-close
, which tellswww
to remove the dev session after the process is closed. This will update in Expo Go in the next polling request or when a user pull-to-refreshes like how it does for Snacks.I also increased the force quit delay to account for the added network calls.
Test Plan
Open a project with a locally built copy of @expo/cli (
nexpo
) on this branch, observe that it shows up in Expo Go, then close the dev server, refresh Expo Go, and see that it doesn't show up anymore:2022-04-21.16-31-08.mp4