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
This commit is contained in:
hailey
2025-07-25 08:57:21 -07:00
committed by GitHub
parent c6b578fe91
commit 15abdc67cf
3 changed files with 27 additions and 63 deletions
+2 -4
View File
@@ -168,11 +168,9 @@ jobs:
header: pull-request-eas-build-${{ github.sha }} header: pull-request-eas-build-${{ github.sha }}
number: ${{ github.event.issue.number }} number: ${{ github.event.issue.number }}
message: | 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 }}) `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)
--- ---
*Generated by [PR labeler](https://github.com/expo/expo/actions/workflows/pr-labeler.yml) 🤖* *Generated by [PR labeler](https://github.com/expo/expo/actions/workflows/pr-labeler.yml) 🤖*
+1 -2
View File
@@ -26,8 +26,7 @@ module.exports = function (_config) {
...(IS_DEV || IS_TESTFLIGHT ? [] : []), ...(IS_DEV || IS_TESTFLIGHT ? [] : []),
] ]
const UPDATES_ENABLED = const UPDATES_ENABLED = IS_TESTFLIGHT || IS_PRODUCTION
IS_TESTFLIGHT !== undefined || IS_PRODUCTION !== undefined
const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN) const USE_SENTRY = Boolean(process.env.SENTRY_AUTH_TOKEN)
+2 -35
View File
@@ -45,7 +45,6 @@ async function updateTestflight() {
const res = await checkForUpdateAsync() const res = await checkForUpdateAsync()
if (res.isAvailable) { if (res.isAvailable) {
await fetchUpdateAsync() await fetchUpdateAsync()
Alert.alert( Alert.alert(
'Update Available', 'Update Available',
'A new version of the app is available. Relaunch now?', 'A new version of the app is available. Relaunch now?',
@@ -70,41 +69,10 @@ export function useApplyPullRequestOTAUpdate() {
const {currentlyRunning} = useUpdates() const {currentlyRunning} = useUpdates()
const [pending, setPending] = React.useState(false) const [pending, setPending] = React.useState(false)
const currentChannel = currentlyRunning?.channel const currentChannel = currentlyRunning?.channel
const isCurrentlyRunningPullRequestDeployment =
currentChannel?.startsWith('pull-request')
const tryApplyUpdate = async (channel: string) => { const tryApplyUpdate = async (channel: string) => {
setPending(true) setPending(true)
if (currentChannel === channel) { await setExtraParamsPullRequest(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()
},
},
],
)
} 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() const res = await checkForUpdateAsync()
if (res.isAvailable) { if (res.isAvailable) {
Alert.alert( Alert.alert(
@@ -119,6 +87,7 @@ export function useApplyPullRequestOTAUpdate() {
text: 'Relaunch', text: 'Relaunch',
style: 'default', style: 'default',
onPress: async () => { onPress: async () => {
await fetchUpdateAsync()
await reloadAsync() await reloadAsync()
}, },
}, },
@@ -130,7 +99,6 @@ export function useApplyPullRequestOTAUpdate() {
`No new deployments of ${channel} are currently available for your current native build.`, `No new deployments of ${channel} are currently available for your current native build.`,
) )
} }
}
setPending(false) setPending(false)
} }
@@ -146,7 +114,6 @@ export function useApplyPullRequestOTAUpdate() {
tryApplyUpdate, tryApplyUpdate,
revertToEmbedded, revertToEmbedded,
currentChannel, currentChannel,
isCurrentlyRunningPullRequestDeployment,
pending, pending,
} }
} }