Skip to content

Apply pending OTA zips on boot; take check/download out of core - #400

Open
shanerbaner82 wants to merge 5 commits into
mainfrom
feat/ota-pending-boot-hook
Open

Apply pending OTA zips on boot; take check/download out of core#400
shanerbaner82 wants to merge 5 commits into
mainfrom
feat/ota-pending-boot-hook

Conversation

@shanerbaner82

Copy link
Copy Markdown
Contributor

OTA check and download never belonged in the runtime. They talk to Bifrost, they care about zip names and UX (manual / prompt / silent), and that is all plugin work. Core should do one thing on boot: if a pending zip is sitting there, extract it instead of (or after) the bundled payload, and do not wipe the app's .env when you do.

That is this PR. iOS already applied Documents/updates/*.zip on next launch; Android now does the same with {appStorageDir}/updates/*.zip. Both stash .env around the extract. The in-core Bifrost client is gone on both platforms. DEBUG still re-extracts the bundle every boot so native:run shows local PHP, and it now skips leftover pending zips, otherwise a queued update covers your working copy. Versioned store builds still apply pending on the next cold start. Bundled names stay app.zip / laravel_bundle.zip (renaming those is a packager lockstep break). A pending zip is additive, so existing installs are fine. The plugin that drops pending.zip will need a min core version that understands this.

Five commits, in order: preserve .env on iOS apply, Android next-boot apply, rip the iOS client, rip the Android client, skip pending in DEBUG.

Shane Rosenthal added 5 commits August 27, 2026 06:58
Stash Documents/app/.env before installUpdate replaces the tree, then
restore it verbatim over the extracted payload. Skip restore when no
prior .env exists. Prefer pending.zip when several updates sit in
Documents/updates.
Extract any *.zip in {appStorageDir}/updates/ into laravel after the
bundled payload, one zip per boot. Stash and restore .env verbatim,
write .ota_applied with the bundled identity so the older bundle is
not re-extracted, and roll back to the bundle when that identity
changes (newer store build).
OTA check/download lives in the mobile-ota plugin. Core still applies
pending zips from Documents/updates on boot via ensureAppExists.
OTA check/download lives in the mobile-ota plugin. Core still extracts
the bundled zip and applies pending zips from updates/ on boot.
DEBUG already re-extracts the bundled payload every boot. Applying a leftover pending zip on top of that hid local PHP. Versioned builds still apply pending on next boot.

@simonhamp simonhamp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Let's go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants