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

feat(expo)!: drop expo-error-recovery #19132

Merged
merged 3 commits into from Sep 21, 2022

Conversation

EvanBacon
Copy link
Contributor

Why

  • expo-error-recovery does not appear to be used anymore with EAS Build / expo-updates. Looks we just used it in Expo Go and shell apps
  • We previously required this module because there was no ability to install native crash reporting libraries like crashlytics.
  • expo-updates appears to have implemented a different version of error-recovery here.

If we want functionality like this, I propose we implement it as an unexposed feature of expo-updates which reports to EAS Update as a type of analytic service. Users who want similar functionality without EAS can use a different native error reporting package with dev clients.

How

This PR simply removes error-recovery from expo, if the proposal is accepted then we'll need to update docs, deprecate the package, and remove code from Expo Go.

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Sep 15, 2022
EvanBacon and others added 2 commits September 15, 2022 15:54
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Sep 16, 2022
Copy link
Member

@tsapeta tsapeta left a comment

Choose a reason for hiding this comment

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

Looks good to me, requesting @lukmccall for review as he might have some input too.

Copy link
Contributor

@lukmccall lukmccall left a comment

Choose a reason for hiding this comment

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

LGTM and I'm okay with that change ;)

Copy link
Member

@ide ide left a comment

Choose a reason for hiding this comment

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

Archaeology

I found the very first commit that documented ErrorRecovery:

Expo can also report custom information back to you after your app reloads. If you use ErrorRecovery.setRecoveryProps, and the app later encounters a fatal JS error, the contents of that method call will be passed back into your app's initial props upon reloading. See Expo.ErrorRecovery.

Expo.ErrorRecovery.setRecoveryProps(props)

Set arbitrary error recovery props. If your project crashes in production as a result of a fatal JS error, Expo will reload your project. If you've set these props, they'll be passed to your reloaded project's initial props under exp.errorRecovery. Read more about error handling with Expo.

It looks like there were two behaviors described here:

  1. The Expo runtime would automatically catch fatal JS errors and reload the app, preventing the app from crashing at the OS level.
  2. You could detect when this happened because your root component would be passed your ErrorRecovery props.

Today

AFAIK we do not automatically reload upon fatal JS errors in most cases. There is one explicit exception, which is when expo-updates launches a new update for the first time and a fatal error occurs early on in the launch process (until right after the root view is initially mounted IIRC).

One thing ErrorRecovery does that expo-updates does not AFAICT is tell the developer when an automatic reload happens. expo-updates has Updates.isEmergencyLaunch, which describes something different (this is when we need to launch an older update, which is dangerous if the last update was backwards-incompatible, and hence used only for emergencies). Will add this as a discussion topic at next week's expo-updates meeting.

Meanwhile, given that automatic reloading happens only in Expo Go and apps made with the Classic Build service which is ending at the start of next year, I have no pragmatic objections to removing ErrorRecovery.

@EvanBacon EvanBacon merged commit 3e03a54 into main Sep 21, 2022
@EvanBacon EvanBacon deleted the @evanbacon/expo/drop-error-recovery branch September 21, 2022 21:20
Ddv0623 pushed a commit to preciofishbone/expo that referenced this pull request Sep 26, 2022
* feat(expo)!: drop expo-error-recovery

* Update CHANGELOG.md

* Update packages/expo/CHANGELOG.md

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>

Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants