Why My Forced Update Wasn't Showing: a Fail-Open Check, Patched Across 13 Old Runtime Versions — Build Log #6
Review & Release

Why My Forced Update Wasn't Showing: a Fail-Open Check, Patched Across 13 Old Runtime Versions — Build Log #6

I raised the server's minimum build to 54, and users on the old build still saw no update screen. The cause was the app-side check: whenever the network call or the build-number read failed, it let you through (fail-open). This is how I closed it on July 24, 2026 by shipping a patch to 13 old runtime versions one by one, the incident I caused along the way, and the real root cause I found weeks later.

KIYODO
#solo dev#iOS#design mistakes#incident report#build log

In my iOS app, the forced update (the mechanism that stops people from staying on an old version) didn't show up for exactly the people on old versions. This post covers the design mistake in the check (fail-open) that caused it, and the July 2026 work of shipping a fixed check to each old runtime version, one at a time.

There is a second post about forced updates. The night I showed the update screen to 30 people in September is written up in The night I asked 30 people to update — Build Log #32 (Japanese). That one is about running the process after the check was fixed: the old builds lacked the components the new screen needed, and the check only ran at cold start. This one is about the period when the check itself was broken.

The short version

  • If raising the server number does nothing, first read which way the app-side check falls when something fails
  • If it falls toward "let through," the only fix is to replace the code inside the app
  • Code updates are partitioned by runtime version, so you need one update per live old runtime version (13 in my case)

Timeline

This wasn't the first time I saw the symptom.

DateWhat happenedWhat I did
July 2After releasing 1.0.3, users on 1.0.2 saw no update screenShipped one fixed update to the old runtime version
July 19Raised the minimum build to 52; build 51 saw nothingSame: one update to one runtime version
July 24Released 1.0.16 (build 54) and raised the minimum to 54; build 52 saw nothingShipped to all 13 runtime versions, 1.0.3 to 1.0.15 (this post)

All three times, the server was correctly returning the new number. The app was the broken part.

The check, before the fix

Here is the core of the check as it stood at build 52.

const HARDCODED_MIN_BUILD = 33; // minimum build baked into the app

function currentBuild(): number {
  const bv = Number(Constants.nativeBuildVersion);
  return Number.isFinite(bv) ? bv : Infinity; // unreadable = "infinitely new"
}

// On launch, ask the server and raise the floor only if a value arrives
setMinBuild((prev) => Math.max(prev, n));

The rule is simple: show the update screen if "my build < minimum build." There are two problems.

  1. The baked-in floor stayed at 33. If the server call fails, the minimum stays at 33. For build 52, 52 < 33 is false, so it passes
  2. If the app can't read its own build number, it returns Infinity. Infinity < 54 is false, so it passes too

Network failure, unreadable build number: either way, let them through. That's fail-open — on failure, open the gate. The opposite is fail-closed — on failure, keep it shut. A forced update exists to stop people, so if it doesn't stop them when something goes wrong, it doesn't do its job.

Why raising the server number can't fix it

The mistake lives inside the app. Code inside the app, as a rule, only changes when the app is updated. And the people with the problem are exactly the people who haven't updated.

The app uses a delivery mechanism that swaps the app's code without going through App Review (Expo's EAS Update). But updates are partitioned by "runtime version" (which generation of native shell they belong to), and only code compatible with that shell will run (Expo: Runtime versions and updates).

The delivery history showed that the last 25 production updates had all targeted the two newest runtime versions (1.0.15 and 1.0.16). Runtime version 1.0.14, where build 52 lived, hadn't received a single new update.

How I fixed it

For each old runtime version:

  1. Find, in the build service's build list, the exact commit that build was made from
  2. Check out that commit
  3. Change two lines of the check
  4. Confirm that file is the only change, then ship to that runtime version
  5. Throw away the edit and return to the working branch

The two lines became:

const HARDCODED_MIN_BUILD = 54;              // 33 → 54: works even if the server can't be reached

return Number.isFinite(bv) ? bv : 0;         // Infinity → 0: unreadable means always stop

I went back to the old source because shipping current code to an old shell makes it call components that aren't in that shell, and it stops working (the same Expo page walks through an example).

So before shipping, I compared package.json (the list of components the app uses) between then and now.

Runtime versionBuildComponents added sinceExisting components with a changed version
1.0.14523 (file access, saving photos, review prompt)none
1.0.15531 (review prompt)none

Only additions; no existing component changed version. The old source never imports the new components, so bundling it with today's installed components doesn't mix anything in. On that basis I shipped. The two updates for builds 52 and 53 went out at 16:19 and 16:20 on July 24.

A script so I wouldn't do 13 by hand

The remaining old runtime versions needed the same work. On both July 19 and July 24, I had counted the target runtime versions by hand and missed one. Do it 13 times by hand and something will go wrong. So I turned the steps into a script (the file was last modified at 16:33 that day).

What the script does:

  • If the working tree has uncommitted changes, it stops without doing anything
  • It reads the build list, picks "production builds below the minimum" per runtime version, and lines up the targets automatically
  • For each runtime version it compares the component lists and skips shipping if any existing component changed version
  • By default it runs in "show what you would do, don't do it" mode. Shipping requires an explicit flag
  • At the end it compares "number of targets" with "number processed" and warns on a mismatch

In the dry-run mode it prints one line per runtime version in this format (copied from the script's format strings):

rv <version> | build<number> | <commit> | <SAFE or DRIFT> | DRY-RUN(would publish) | <component diff>
対象 <targets> / 処理 <processed> (漏れなし)

(The last line is in Japanese in the script: "targets / processed (no gaps)".)

The dry-run mode paid off immediately. In the first version, the component comparison always said SAFE. After checking out the old source, it compared against "now" — which by then was the same commit, so it was comparing a thing with itself. I changed it to compare against the branch from before the checkout, and only then shipped. Had I shipped straight away, I would have pushed code to old shells without actually checking whether it was safe.

In the end, the fixed check reached all 13 runtime versions from 1.0.3 to 1.0.15. The oldest, 1.0.0, was built before the check existed, so I left it out. Even older builds whose runtime version wasn't a plain version number were also excluded.

The incident I caused along the way

In the middle of this, I put the update wall in front of everyone on the latest version.

While it works, the script leaves the repository in the state "old source plus the edited check." During that window, I shipped an unrelated update (a redesigned insights screen) to the newest runtime version, 1.0.16.

The delivery tool bundles whatever is in the working folder at that moment. The check with the floor set to 54 went into the latest version too, the unreadable build number became 0, and even build 54 — the newest — hit the wall.

I re-shipped from a clean folder at around 21:47, according to the delivery record. People on the latest version could recover by fully closing the app and opening it again.

The first rule in my procedure is now: "while a script that rewrites the working folder is running, don't ship and don't build." Right before shipping I check three things — branch name, no uncommitted changes, the check file is the normal version — and stop if any one fails.

The real root cause, found later (August 18)

In July I believed the check "let people through when the build number happened to be unreadable." On August 18 I read the check again and found that wasn't it.

The property it read, Constants.nativeBuildVersion, does not exist in the component I was using (expo-constants). The value was always empty, turned into a non-number, and became Infinity. In other words, every device was let through, every time. I confirmed that the build number was empty across all 3,279 launch records from 54 people.

Type checking didn't catch it either. That component's type allows any property name, so reading a nonexistent one raised no error.

On August 18 I switched the read to Constants.platform.ios.buildNumber, which actually holds the build number. On August 21, changing a single number on the server was enough to show the update screen. Looking back, the code I shipped to 13 runtime versions in July was holding this defect down from above with the baked-in floor.

"Fail-closed everywhere" had its own trap

On August 20 I fixed the opposite problem. If an unreadable build number is treated as 0, then 0 < minimum build is true and unrelated devices get stopped. The records showed 22 occurrences, up to 8 people, blocked wrongly this way.

So now each part has its own job:

PartWhich way it falls on failureWhy
Baked-in minimumStop (works without the server)Old versions must be stopped reliably
Build number unreadableLet throughDon't drag people on new versions into it
Server call failsRetry once after 2 secondsMost failures were brief network drops

"A mechanism that stops people should fall toward stopping" is right. But if you also make the evidence you stop people on fall toward stopping, you stop the wrong people. My current answer is to harden only the parts where the evidence is solid.

What I took away

  • A correct server value does nothing if the app can't read its own value. When the screen doesn't show, check the app-side value in your logs first
  • Log whether the update screen was actually shown. In July I couldn't tell from the server whether it had appeared, and that delayed finding the cause
  • Ship to old runtime versions from the source they were built from. Check the component diff before shipping
  • Don't run outward-facing commands while the working folder is being rewritten

FAQ

What should I check first when a forced update isn't showing? Three things. (1) Is the server returning the new minimum version? (2) Can the app actually read its own build number? (Log the real value.) (3) When the network call or the read fails, does the check fall toward "let through"? In my case (1) was fine, and (2) and (3) were broken.

Isn't over-the-air code swapping dangerous? Yes. Ship code that doesn't match the native shell and it calls components that aren't there and stops working. That's why I checked the component diff for each old runtime version before shipping.

What happened with forced updates after this? The September round, after the check was fixed, is in The night I asked 30 people to update — Build Log #32 (Japanese). The check worked, but I tripped over something else.

The app in this post

Everything above is from building THE TASK: AI To-Do Prep (App Store, free), an iOS app I develop solo. The idea is that AI fills a written task out until it's actually actionable. The rest of the series lives in the build log.

Sources

  • Expo: Runtime versions and updates — runtime versions guarantee compatibility between a build's native code and an update; an update that calls native code missing from the build fails, and expo-updates may try to roll back to the previous update

Comments (0)

No comments yet. Be the first to leave one.