Roll back a release
Return a channel to an earlier bundle as a new release, or revoke a bad release for good, and check where its devices land.
A rollback is a new release of an earlier bundle. The channel's release log keeps every step, and devices move to the old bundle like to any update. A revocation ends a release for good: a device running it moves to the newest older release it qualifies for, or to the embedded bundle.
Older code then runs over the data the newer bundle wrote. That is why an update only adds to stored data and never renames, removes or retypes it, the first of the three disciplines. A channel switch through setChannel has the same effect as a rollback.
Pick by what the devices should run next:
- Roll back when devices should run a known-good bundle at once. The rollback release is mandatory by default, so devices apply it as soon as they have downloaded it.
- Revoke when the release must not run anywhere and the release below it is the right place for its devices. Revoked is final, and the bundle comes back only through a new release.
| Action | The release | Devices running it |
|---|---|---|
| Pause | The release stops being offered until it is resumed. | They keep it, and a downloaded copy not yet applied is discarded. |
| Revoke | The release ends for good and is listed as revoked. | They move to the eligible release with the next lower number, or to the embedded bundle. |
| Rollback | The release stays as it is, and a new release of an older bundle is created above it. | They take the new release like any update. |
Prerequisites
- The channel has at least two releases, since a rollback returns to one of them.
- You hold the Owner or Admin role when the channel is protected. Channels explains the flag.
1. Find the release to return to
If you know the release number, skip to step 2.
npx hotcodepush release list --channel productionThe log lists the channel's releases newest first with their bundle, status, rollout and device count. #17 · 1.4.1 is bundle 17 under its version label.
2. Roll back
npx hotcodepush release rollback --channel productionWithout --to-release the target is the channel's previous release, and --to-release 41 names another. The CLI states the target and the reach, asks once and prints the new release's number. release rollback has every flag, --mandatory false among them.
The new release carries the target's bundle and conditions, records the release it replaces and applies within about a minute. A mandatory release restarts the app as soon as it is downloaded, unless the app set mandatoryApplyStrategy to manual, as Choose an apply strategy shows. If nothing happens, see Troubleshooting.
3. Or revoke instead
npx hotcodepush release revoke --release 43The CLI states where the devices go and asks once. The same command, release revoke, also revokes a range of releases, every release of a channel or every release of a bundle.
A revocation applies within about a minute, and a device running the release leaves it on its next check. It takes a newer eligible release under its apply strategy. Otherwise it moves at once to the newest older release it qualifies for, or to the embedded bundle.
Revoked is final: npx hotcodepush release create --bundle 18 releases the bundle again as a new release.
4. Verify on devices
npx hotcodepush release get --release 44The rollback release's device count and applied counter rise as devices check in. The probe, npx hotcodepush device probe --device <id>, evaluates one device against every live release.
A device that still shows the old release has not checked yet. If nothing happens, see Troubleshooting.
The device's own rollback
A release that fails to come up is rolled back on the device within seconds. After every apply the readiness gate waits for the app's first render, 10 seconds by default. A timeout or a crash reverts the device to the last confirmed bundle or the embedded one and blocks the bundle on that device.
The device reports the failure, and rollbackUpdate({ reason }) does the same from your code. The next start fires updateRolledBack once:
import { HotCodePush } from "@hotcodepush/capacitor-live-updates";
void HotCodePush.addListener("updateRolledBack", ({ fromRelease, toRelease, reason }) => {
// fromRelease failed on this device; toRelease is null when the embedded bundle runs now.
console.warn(`Rolled back from release #${fromRelease.number} (${reason})`, toRelease);
});Those failure reports are what auto-pause counts, as Rollouts and auto-pause explains.
Next steps
- Roll out gradually: a rollout that pauses on failures makes a rollback rarer.
- Choose an apply strategy decides who restarts the app after a mandatory release.
- release lists every flag of
release rollback,release revokeandrelease create --bundle.
Last updated on
Roll out gradually
Release to a share of devices first, widen the rollout by hand or on a schedule, and let auto-pause stop a release whose failures climb.
Sign your bundles
Create a signing key pair, ship a build that trusts it, sign every upload in CI and rotate or retire keys without breaking devices in the field.