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-updates implementation #3092

Closed
wants to merge 60 commits into from
Closed

expo-updates implementation #3092

wants to merge 60 commits into from

Conversation

haileyok
Copy link
Contributor

@haileyok haileyok commented Mar 4, 2024

Expo Updates

This PR implements the expo-updates client into the app. It replies on the Bluesky updates server which uses the expo-updates protocol.

I've opted to stray from the default options here and never check automatically at app launch. I'm not certain of the start-time implications across devices and networks if we take that route. I believe that setting the fallbackToCacheTimeout to zero would prevent that, but I would rather remain safe and manually check for the update once the app has launched.

Once a user opens the app, we set a timeout for 15 seconds that will check for an update. If there is an update available, it will be fetched in the background but will not be used for that launch. We also check for an update each time the user opens the app from the background, assuming that 30 minutes has passed between the last time they opened the app and now.

New updates will be used whenever one of two things happens:

  1. The next time the user launches the app (i.e. after a force quit or after watchdog terminates the app)
  2. After the app has been in the background for 30 minutes or more

In the first situation, there isn't much thinking that we need to do. In the latter, we use a 30 minute time period to ensure that this wasn't the user backgrounding the app to go watch a short video or something, then come back to the app expecting to be in the same state. A 30 minute period is generally enough time for to feel confident in reloading the app without affecting the user's flow. This only happens if an update is available.

Deploy Process

The deploy process is pretty straight forward.

  • We merge in changes to main
  • We run the action, inputting the version that the update is for. By inputting a version, we allow ourselves two options:
    • The version that is currently live on the app store
    • The version that is being used internally for TestFlight

By having this distinction, we can deploy changes rapidly for testing internally while maintaining the version that production users are using.

Test Plan

Created a TestFlight release and an APK that has an Alert at launch. This update was deployed and installed on devices. After restarting the app, the message no longer appears, indicating that the new bundle has been properly installed.

We should use this internally on a TestFlight release for a bit before using it in production.

@haileyok haileyok marked this pull request as ready for review March 14, 2024 18:16
@bluesky-social bluesky-social deleted a comment from github-actions bot Mar 15, 2024
Copy link

github-actions bot commented Mar 15, 2024

The Pull Request introduced fingerprint changes against the base commit: 5b4b8e4

Fingerprint diff
[
  {
    "type": "dir",
    "filePath": "node_modules/expo-updates/ios",
    "reasons": [
      "expoAutolinkingIos"
    ],
    "hash": "d46bff4299ab6eed3a7e3a2488215fad8eaa164d"
  },
  {
    "type": "dir",
    "filePath": "patches",
    "reasons": [
      "patchPackage"
    ],
    "hash": "888e27fa069294187b187c178bdafbaf3a95670f"
  },
  {
    "type": "contents",
    "id": "expoConfig",
    "contents": "{\"android\":{\"adaptiveIcon\":{\"backgroundColor\":\"#1185FE\",\"backgroundImage\":\"./assets/icon-android-background.png\",\"foregroundImage\":\"./assets/icon-android-foreground.png\",\"monochromeImage\":\"./assets/icon-android-foreground.png\"},\"googleServicesFile\":\"./google-services.json\",\"icon\":\"./assets/icon.png\",\"intentFilters\":[{\"action\":\"VIEW\",\"autoVerify\":true,\"category\":[\"BROWSABLE\",\"DEFAULT\"],\"data\":[false,{\"host\":\"bsky.app\",\"scheme\":\"https\"}]}],\"package\":\"xyz.blueskyweb.app\",\"splash\":{\"backgroundColor\":\"#0c7cff\",\"dark\":{\"backgroundColor\":\"#0f141b\",\"image\":\"./assets/splash-dark.png\",\"resizeMode\":\"cover\"},\"image\":\"./assets/splash.png\",\"resizeMode\":\"cover\"}},\"androidStatusBar\":{\"backgroundColor\":\"#00000000\",\"barStyle\":\"light-content\"},\"assetBundlePatterns\":[\"**/*\"],\"extra\":{\"eas\":{\"build\":{\"experimental\":{\"ios\":{\"appExtensions\":[{\"bundleIdentifier\":\"xyz.blueskyweb.app.Share-with-Bluesky\",\"entitlements\":{\"com.apple.security.application-groups\":[\"group.app.bsky\"]},\"targetName\":\"Share-with-Bluesky\"}]}}},\"projectId\":\"55bd077a-d905-4184-9c7f-94789ba0f302\"}},\"hooks\":{\"postPublish\":[{\"config\":{\"dist\":\"undefined.1.73.0.undefined\",\"organization\":\"blueskyweb\",\"project\":\"react-native\",\"release\":\"1.73.0\"},\"file\":\"sentry-expo/upload-sourcemaps\"}]},\"icon\":\"./assets/icon.png\",\"ios\":{\"associatedDomains\":[\"applinks:bsky.app\",\"applinks:staging.bsky.app\"],\"bundleIdentifier\":\"xyz.blueskyweb.app\",\"config\":{\"usesNonExemptEncryption\":false},\"entitlements\":{\"com.apple.security.application-groups\":\"group.app.bsky\"},\"infoPlist\":{\"NSCameraUsageDescription\":\"Used for profile pictures, posts, and other kinds of content.\",\"NSMicrophoneUsageDescription\":\"Used for posts and other kinds of content.\",\"NSPhotoLibraryAddUsageDescription\":\"Used to save images to your library.\",\"NSPhotoLibraryUsageDescription\":\"Used for profile pictures, posts, and other kinds of content\",\"UIBackgroundModes\":[\"remote-notification\"]},\"splash\":{\"backgroundColor\":\"#ffffff\",\"dark\":{\"backgroundColor\":\"#001429\",\"image\":\"./assets/splash-dark.png\",\"resizeMode\":\"cover\"},\"image\":\"./assets/splash.png\",\"resizeMode\":\"cover\"},\"supportsTablet\":false},\"name\":\"Bluesky\",\"orientation\":\"portrait\",\"owner\":\"blueskysocial\",\"platforms\":[\"android\",\"ios\",\"web\"],\"plugins\":[\"./plugins/shareExtension/withShareExtensions.js\",\"./plugins/withAndroidManifestFCMIconPlugin.js\",\"./plugins/withAndroidManifestPlugin.js\",\"./plugins/withAndroidStylesWindowBackgroundPlugin.js\",\"expo-localization\",[\"expo-build-properties\",{\"android\":{\"buildToolsVersion\":\"34.0.0\",\"compileSdkVersion\":34,\"kotlinVersion\":\"1.8.0\",\"newArchEnabled\":false,\"targetSdkVersion\":34},\"ios\":{\"deploymentTarget\":\"13.4\",\"newArchEnabled\":false}}],[\"expo-notifications\",{\"color\":\"#1185fe\",\"icon\":\"./assets/icon-android-notification.png\"}]],\"scheme\":\"bluesky\",\"sdkVersion\":\"50.0.0\",\"slug\":\"bluesky\",\"splash\":{\"backgroundColor\":\"#ffffff\",\"image\":\"./assets/splash.png\",\"resizeMode\":\"cover\"},\"updates\":{\"checkAutomatically\":\"NEVER\",\"codeSigningCertificate\":\"./code-signing/certificate.pem\",\"codeSigningMetadata\":{\"alg\":\"rsa-v1_5-sha256\",\"keyid\":\"main\"},\"enabled\":false,\"fallbackToCacheTimeout\":30000,\"url\":\"https://updates.bsky.app/manifest\"},\"userInterfaceStyle\":\"automatic\",\"version\":\"1.73.0\",\"web\":{\"favicon\":\"./assets/favicon.png\"}}",
    "reasons": [
      "expoConfig"
    ],
    "hash": "d59da7540bac6685b669a372fd064d727c41c2cb"
  }
]

Generated by PR labeler 🤖

@haileyok haileyok changed the base branch from main to hailey/expo-updates-action March 19, 2024 17:30
@haileyok haileyok changed the base branch from hailey/expo-updates-action to main March 19, 2024 17:31
@haileyok haileyok force-pushed the hailey/expo-updates branch from de9e913 to 230de84 Compare March 19, 2024 18:46
@haileyok
Copy link
Contributor Author

haileyok commented Apr 2, 2024

Closing in favor of #3291

@haileyok haileyok closed this Apr 2, 2024
@haileyok haileyok deleted the hailey/expo-updates branch April 5, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant