← Binderdex dev log

A stale simulator binary looked like a library crash

#mobile#infra#solo-founder

An amber code bundle sends one line to a live phone while a coral bar stops its second line short of an outdated, dashed phone

React Native Worklets kept crashing on my simulator, but only sometimes. Same code, same branch, same machine, and a crash that looked like a library bug.

I was testing the mobile app for BinderDex, my Pokémon card collection and price app, in the iOS simulator. Worklets is a library that runs small pieces of JavaScript off the main thread, and it was fine. The crash fired whenever current JavaScript attached to an obsolete 1.1.6 build of the app installed on the simulator. The bundle expected one runtime, the native side ran another, and Worklets died trying to bridge them. A freshly built client always worked, which is exactly why I kept suspecting my own code.

Refuse to boot a stale client

Hunting through the Worklets stack was the wrong job. I added a runtime identity guard to the BinderDex mobile scripts instead. Metro startup (the JavaScript bundler), onboarding audits and every Maestro end-to-end test entry point now compare the installed app's version and Expo runtime against source. On a mismatch the script refuses to run and prints the exact rebuild command.

The check is small, and it turns a confusing crash into a named reason:

export function assessIosClient({ expected, installed }) {
  const reasons = [];
  if (installed.version !== expected.version) {
    reasons.push(`app version ${installed.version} (expected ${expected.version})`);
  }
  if (expected.runtime && installed.runtime !== expected.runtime) {
    reasons.push(`Expo runtime mismatch: ${installed.runtime}`);
  }
  return { status: reasons.length ? "stale" : "current", reasons };
}

It reads the installed identity from the app's plist with plutil and the expected one from Expo config. Four regression tests lock the behavior in.

One interruption at a time

The same night, notification permission prompts, feedback sheets and the native app-store review nudge stopped fighting over the screen. A single shared component that hands out the right to show a prompt gives one interruption the floor, lets higher priority jump the queue and keeps equal priorities in order.

The guard surfaced two test bugs

Moving from 1.1.12 to 1.1.13 for the next build I'd send through store testing exposed two test defects. Android E2E was being blocked by the package-level iOS guard, so the Android runner now starts its test variant directly. Maestro's email sign-in fallback tapped a button that stayed mounted while busy, and the delayed tap could land on Home and open a binder idea, one of the app's ready-made binder page suggestions. It now waits for the idle "Log in" label.

A crash that comes and goes is often an environment problem wearing a code problem's stack trace. I now make the environment prove its identity before anything runs on it.

This is the build log for Binderdex (www.binderdex.com) · All entries · Weekly essays