diff options
author | hailey <me@haileyok.com> | 2025-07-25 08:57:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-25 08:57:21 -0700 |
commit | 15abdc67cf77444f20c760537e0e5ca4f9aca5d5 (patch) | |
tree | 7766b3c511e04855b69f23e7ffc5aedf38739440 | |
parent | c6b578fe918b56d83c683f089ca7266535bab766 (diff) | |
download | voidsky-15abdc67cf77444f20c760537e0e5ca4f9aca5d5.tar.zst |
simplify logic for pull request OTAs (#8720)
* simplify logic for pull request OTAs * just render deep link in the text * dont download update until approved
-rw-r--r-- | .github/workflows/pull-request-comment.yml | 6 | ||||
-rw-r--r-- | app.config.js | 3 | ||||
-rw-r--r-- | src/lib/hooks/useOTAUpdates.ts | 81 |
3 files changed, 27 insertions, 63 deletions
diff --git a/.github/workflows/pull-request-comment.yml b/.github/workflows/pull-request-comment.yml index 8a9e9d9b5..e16d6fe94 100644 --- a/.github/workflows/pull-request-comment.yml +++ b/.github/workflows/pull-request-comment.yml @@ -168,11 +168,9 @@ jobs: header: pull-request-eas-build-${{ github.sha }} number: ${{ github.event.issue.number }} message: | - Your requested OTA deployment was successful! You may now apply it by pressing the link below. + Your requested OTA deployment was successful! You may now apply it by opening the deep link below in your browser: - [Apply OTA update](bluesky://intent/apply-ota?channel=pull-request-${{ github.event.issue.number }}) - - [Here is some music to listen to while you wait...](https://www.youtube.com/watch?v=VBlFHuCzPgY) + `bluesky://intent/apply-ota?channel=pull-request-${{ github.event.issue.number }}` --- *Generated by [PR labeler](https://github.com/expo/expo/actions/workflows/pr-labeler.yml) 🤖* diff --git a/app.config.js b/app.config.js index 26d1dcae5..057806f79 100644 --- a/app.config.js +++ b/app.config.js @@ -26,8 +26,7 @@ module.exports = function (_config) { ...(IS_DEV || IS_TESTFLIGHT ? [] : []), ] - const UPDATES_ENABLED = - IS_TESTFLIGHT !== undefined || IS_PRODUCTION !== undefined + const UPDATES_ENABLED = IS_TESTFLIGHT || IS_PRODUCTION const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN) diff --git a/src/lib/hooks/useOTAUpdates.ts b/src/lib/hooks/useOTAUpdates.ts index 72f215fa9..d235694ad 100644 --- a/src/lib/hooks/useOTAUpdates.ts +++ b/src/lib/hooks/useOTAUpdates.ts @@ -45,7 +45,6 @@ async function updateTestflight() { const res = await checkForUpdateAsync() if (res.isAvailable) { await fetchUpdateAsync() - Alert.alert( 'Update Available', 'A new version of the app is available. Relaunch now?', @@ -70,66 +69,35 @@ export function useApplyPullRequestOTAUpdate() { const {currentlyRunning} = useUpdates() const [pending, setPending] = React.useState(false) const currentChannel = currentlyRunning?.channel - const isCurrentlyRunningPullRequestDeployment = - currentChannel?.startsWith('pull-request') const tryApplyUpdate = async (channel: string) => { setPending(true) - if (currentChannel === channel) { - const res = await checkForUpdateAsync() - if (res.isAvailable) { - logger.debug('Attempting to fetch update...') - await fetchUpdateAsync() - Alert.alert( - 'Deployment Available', - `A new deployment of ${channel} is availalble. Relaunch now?`, - [ - { - text: 'No', - style: 'cancel', - }, - { - text: 'Relaunch', - style: 'default', - onPress: async () => { - await reloadAsync() - }, + await setExtraParamsPullRequest(channel) + const res = await checkForUpdateAsync() + if (res.isAvailable) { + Alert.alert( + 'Deployment Available', + `A deployment of ${channel} is availalble. Applying this deployment may result in a bricked installation, in which case you will need to reinstall the app and may lose local data. Are you sure you want to proceed?`, + [ + { + text: 'No', + style: 'cancel', + }, + { + text: 'Relaunch', + style: 'default', + onPress: async () => { + await fetchUpdateAsync() + await reloadAsync() }, - ], - ) - } else { - Alert.alert( - 'No Deployment Available', - `No new deployments of ${channel} are currently available for your current native build.`, - ) - } + }, + ], + ) } else { - setExtraParamsPullRequest(channel) - const res = await checkForUpdateAsync() - if (res.isAvailable) { - Alert.alert( - 'Deployment Available', - `A deployment of ${channel} is availalble. Applying this deployment may result in a bricked installation, in which case you will need to reinstall the app and may lose local data. Are you sure you want to proceed?`, - [ - { - text: 'No', - style: 'cancel', - }, - { - text: 'Relaunch', - style: 'default', - onPress: async () => { - await reloadAsync() - }, - }, - ], - ) - } else { - Alert.alert( - 'No Deployment Available', - `No new deployments of ${channel} are currently available for your current native build.`, - ) - } + Alert.alert( + 'No Deployment Available', + `No new deployments of ${channel} are currently available for your current native build.`, + ) } setPending(false) } @@ -146,7 +114,6 @@ export function useApplyPullRequestOTAUpdate() { tryApplyUpdate, revertToEmbedded, currentChannel, - isCurrentlyRunningPullRequestDeployment, pending, } } |