| b2cf986b | 13-Feb-2023 |
Will Schurman <[email protected]> |
[expo-updates][android] Add rollback to embedded update directive (#21007)
# Why
Part 2 of https://github.com/expo/expo/pull/20275. This adds the new
"rollback to embedded update" directive.
[expo-updates][android] Add rollback to embedded update directive (#21007)
# Why
Part 2 of https://github.com/expo/expo/pull/20275. This adds the new
"rollback to embedded update" directive.
This adds support for a new directive type, `rollbackToEmbedded` -
compliant servers may send this back to direct expo-updates to roll back
to the embedded update.
# How
Roll back to embedded is accomplished by finding the embedded update in
the database and setting it's commit time to that of the rollback
message. This will have the effect of launching the embedded update iff
there isn't a newer update in the db. Subsequent published updates will
have later commit times and will take precedence over the embedded
(until another rollback is published).
Some questions:
- Does this risk corruption of embedded updates? (permanently mutating
it on the client)
# Test Plan
Run tests.
Manually test rollbacks by doing the following:
1. Implement the new protocol in
https://github.com/expo/custom-expo-updates-server/pull/15
- This links expo-updates in package.json to the local copy (this PR)
`../../expo/packages/expo-updates`
- This also sets up `bundleInDebug: true` and `devDisabledInDebug: true`
so that it loads updates in debug mode.
3. `npx expo prebuild` the example client.
4. Open the example client in android studio (verify it has new code
from this PR)
5. Run the example server.
6. Build and run the client.
7. See embedded update on the client.
8. `yarn expo-publish`, kill and restart running client, see new update
is downloaded and run
9. `yarn expo-publish-rollback`, kill and restart running client, see
embedded update is run
10. `yarn expo-publish`, kill and restart running client, see new update
is downloaded and run
# Checklist
<!--
Please check the appropriate items below if they apply to your diff.
This is required for changes to Expo modules.
-->
- [ ] Documentation is up to date to reflect these changes (eg:
https://docs.expo.dev and README.md).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
- [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg:
updated a module plugin).
show more ...
|