Skip to content

feat(app-update): mount the version-gate UI on the home screen - #701

Merged
islandbitcoin merged 3 commits into
mainfrom
feat/mount-app-update
Aug 20, 2026
Merged

islandbitcoin merged 3 commits into
mainfrom
feat/mount-app-update

Conversation

@bobodread876

@bobodread876 bobodread876 commented Aug 19, 2026 •

Copy link
Copy Markdown
Collaborator

Why

There is no way to get users onto a new build today. The AppUpdate component — a soft "update available" banner and a blocking "update mandatory" modal, both driven by the public mobileVersions query — has existed since the galoy fork but was never mounted anywhere, and its banner text was commented out. Case in point: a user on an old build hit the Fygaro over-cap charge bug that newer code already fixes, and we had no in-app lever to move them.

What

  • home-screen: render the soft banner
  • app.tsx: mount the blocking gate via AppUpdateBoundary, which shares one version check with the banner and pins the modal as the last sibling (it renders with coverScreen={false} for the Fabric modal-host bug, so paint order follows sibling order). Mounted app-wide rather than on Home so deep-link cold starts can't bypass it.
  • app-update:
    • restore the banner text (the i18n string already existed)
    • bug fix: check required before available. required implies available (build < min ≤ current), so the blocking modal was unreachable behind the soft banner — a render test caught this.
    • re-check on foreground, so a raised minBuildNumber reaches apps resident in memory for days
    • surface store / mail-composer failures inline instead of leaving the tap a silent no-op
    • the gate's Contact Support button composes mail directly. The shared contact-modal helper points at wa.flashapp.me, which as of 2026-08-19 returns 200 with zero redirects and no wa.me anywhere — a static "temporarily unavailable" page that discards ?text=. Kept local so no other caller's behavior changes.

Behavior

server says user sees
build ≥ currentSupported nothing
minSupported ≤ build < currentSupported tappable "An update is available" banner → store
build < minSupported blocking modal (update / contact support)
query not loaded / unknown platform nothing (never block on bad data)

Tests

549 pass, tsc:check clean. New coverage: banner/gate split, the store link on both platforms, the mandatory modal's buttons (the only escape from a modal with no dismiss), failure paths for both, foreground re-check, and the app-wide mount.

⚠️ Deploy order

Two gates, both before a release containing this ships:

  1. lnflash/deployments#166. Prod mobileVersions currently serves the schema defaults (min = last = 362), which would hard-block every real build. Apply it first.
  2. Fabric device check on Android — still outstanding. New Architecture is on for both platforms (android/gradle.properties:35, ios/Podfile:1) and jest has no layout engine, so no test in this PR can prove the blocking modal measures correctly on a real Fabric build. The modal renders with coverScreen={false} specifically to dodge the broken RCTModalHostView measurement (feat: enable React Native New Architecture (Fabric + TurboModules) #545); if that inline path is wrong on device the failure mode is a hard-blocked user staring at a blank frozen screen with no dismiss, no back button and no in-app escape — exactly what this PR exists to prevent. Check: on an Android New-Architecture build, point the app at an API returning minSupported above the local build, then confirm (a) the modal renders full-screen, (b) both "Update" and "Contact Support" are tappable, (c) the hardware back button does nothing. Record the result on this PR before the release build ships.
# Gate Status
1 lnflash/deployments#166 applied to prod ☐
2 Android Fabric device check (modal renders, buttons tappable, back button inert) ☐

🤖 Generated with Claude Code

https://claude.ai/code/session_016MsAGwtS4sNodzWu2VMTKR

bobodread876 pushed a commit that referenced this pull request Aug 19, 2026
…, single source

Review fixes for PR #701:

- coverScreen={false} on the mandatory-update modal. It was the only
  react-native-modal in the tree without it — the exact omission #673/#674 fixed
  for seven other modals to stop the Fabric/New-Arch freeze on Android. Its
  children are flex-filled with a bottom-pinned spacer, so RCTModalHostView
  would push "Tap here to update" and "Contact Support" off-screen while the
  opaque backdrop keeps eating touches: an unescapable white screen on a modal
  with no dismiss, no backdrop press and a swallowed hardware back button.
  Because the inline path makes paint order follow sibling order, <AppUpdateGate />
  now mounts as the last child in app.tsx instead of ahead of RootStack.

- The store-link failure is rendered inside the modal instead of a toast.
  toastShow is dropped when a modal is already up (FIXME in utils/toast), so on
  the blocking path a failed openURL was a silent no-op with no way out.
  AppUpdateGate holds the openFailed state; the banner keeps the toast, which is
  reachable there.

- One version check for the whole app. AppUpdateProvider owns the query
  subscription and the AppState listener; the gate and the home banner consume
  it. Previously each mounted its own hook — two sources of truth for "am I
  blocked?", with the banner re-deriving the gate's negation.

- Release checklist + preflight for the deploy-order dependency. The served
  mobileVersions payload lives in lnflash/deployments, so a stale floor
  hard-blocks the whole install base at launch (prod currently serves min 362
  against builds android 89 / ios 51). docs/release.md now carries the step, and
  `yarn check:version-gate [--api <url>]` compares the served payload against
  this checkout's build numbers and exits non-zero when the gate would block the
  release.

Tests:
- pin coverScreen={false} on the gate's modal
- foreground re-check now asserts the refetched payload actually flips the gate
  (rerender case) plus an end-to-end case over a real Apollo link with two
  sequential responses
- Android store-link coverage in a sibling spec (isIos is captured at module
  load), for both the blocking modal and the banner
- inline failure message replaces the toast assertion on the blocking path, and
  the banner's toast keeps its own case
- one AppState listener for the tree, and a consumer without the provider throws
- version-gate parsing/comparison unit tests
bobodread876 pushed a commit that referenced this pull request Aug 19, 2026
…ld (review)

Round-2 review fixes for PR #701:

- The version-gate preflight now runs on the ship path, not just in a doc.
  android-deploy, ios-deploy and ios-alt-deploy all build and upload via
  fastlane on a `*/v*` tag push or workflow_dispatch, and none of them ran the
  check — the only thing between a stale floor and a bricked install base was a
  human remembering a bullet in docs/release.md, the same class of control the
  previous round rejected. Each workflow now runs `yarn check:version-gate`
  right after `yarn install --frozen-lockfile`, before fastlane builds
  anything. Running pre-fastlane is sound: fastlane bumps the build number
  later in the lane, and a floor at or below the pre-bump build is also at or
  below the post-bump one, so the hard-block error cannot be missed (only the
  currentSupported warning can go stale). An unreachable API fails the deploy
  too — for a kill-switch guard, "unknown" must not read as "safe".

  Note this makes deploys fail until lnflash/deployments#166 is merged AND
  applied: prod still serves min 362 against builds android 89 / ios 51, which
  is exactly the release this guard exists to stop.

- openWhatsAppAction uses its `message` argument. It took a message and called
  openWhatsAppUrl(WHATSAPP_SUPPORT_URL), discarding it, so the OS + build
  number AppUpdateGate carefully builds went nowhere. That path is now
  load-bearing: it is the documented second escape hatch from a modal with no
  dismiss, and couldNotOpenStore points users straight at it, so support was
  being paged by exactly the users who cannot look up their own build. The
  message is appended as an encoded `?text=` (wa.flashapp.me forwards to wa.me,
  which prefills the composer from it); a forwarder that drops the query just
  opens support empty, which is what this already did.

- check-version-gate's `--api` accepts both spellings and rejects a bare flag.
  It matched only `process.argv.indexOf("--api")`, so
  `--api=https://api.staging.flashapp.me/graphql` — the form most people type —
  fell through to the prod default and printed a green checkmark about an
  environment nobody asked about. Parsing moved to utils/version-gate.ts as
  `parseFlag(argv, name)` so it is reachable from tests without running the CLI,
  and a valueless `--api` now throws instead of silently defaulting. The api and
  builds lines are printed before the request, so a network failure still names
  the environment that was checked.

Tests:
- the gate's Contact Support button: pressed, asserted to call
  openWhatsAppAction once with a message carrying the readable version and the
  OS, both on the clean path and after the store link has failed (the state
  couldNotOpenStore tells users to use it from). The mocks in the two gate specs
  were bare jest.fn()s nothing asserted on, so an unwired onPress shipped green;
  verified all three new cases fail against an unwired button.
- openWhatsAppAction unit spec: the message reaches the URL, and is encoded
  rather than spliced in raw. Verified both fail against the old body.
- parseFlag: both spellings, values containing "=", absent flag, and the three
  valueless forms.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_016MsAGwtS4sNodzWu2VMTKR
The AppUpdate component — a soft 'update available' banner and a
blocking 'update mandatory' modal, both driven by the public
mobileVersions query — has existed since the galoy fork but was never
mounted anywhere, and its banner text was commented out. No update
prompt has ever shipped, so there was no way to move users off an old
build.

- home-screen: render the soft banner
- app.tsx: mount the blocking gate via AppUpdateBoundary, which shares
  one version check with the banner and pins the modal as the last
  sibling (it renders with coverScreen={false} for the Fabric modal-host
  bug, so paint order follows sibling order). Mounted app-wide rather
  than on Home so deep-link cold starts cannot bypass it.
- app-update: restore the banner text; check 'required' before
  'available' — required implies available, so the blocking modal was
  unreachable behind the banner; re-check on foreground so a raised
  minBuildNumber reaches apps resident in memory for days; surface store
  and mail-composer failures instead of leaving the tap a silent no-op.
- The gate's Contact Support button composes mail directly. The shared
  contact-modal helper points at wa.flashapp.me, which as of 2026-08-19
  returns 200 with zero redirects and no wa.me anywhere — a static
  'temporarily unavailable' page that discards ?text=. Kept local so no
  other caller's behavior changes.

543 tests pass; tsc clean.

DEPLOY ORDER: prod mobileVersions currently serves the schema defaults
(min=last=362), which would hard-block every real build. lnflash/
deployments#166 must be applied before a release containing this ships.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016MsAGwtS4sNodzWu2VMTKR
@bobodread876
bobodread876 force-pushed the feat/mount-app-update branch from bfadf74 to 2cc8732 Compare August 19, 2026 19:44
- openInStore now tries `market://details?id=<bundleId>` on Android before
  the https Play Store listing. Any browser resolves the https URL, so the
  documented failure trigger ("an Android device with no Play Store") could
  never fire: a hard-blocked user on a de-Googled or Huawei device landed on
  a web page they cannot install from, with no hint that Contact Support was
  the way out. The store-app scheme lands them where they can install, and
  makes the rejection path reachable when nothing on the device takes it.

- AppUpdateModal's `contactSupport` is now required. It drives one of only
  two escapes from a modal with no dismiss, no backdrop press and a swallowed
  back button; optional meant a caller could ship a dead button with no type
  error, and both stories did — including the store-link-failed story, which
  rendered "Tap Contact Support below for help" over a no-op.

- The banner's failure toast passes `currentTranslation: LL` (utils/toast
  falls back to English without it, and logs isTranslated: false every time)
  and uses a new `AppUpdate.couldNotOpenStoreBanner` string. The gate's copy
  points at a Contact Support button that does not exist on the home screen.

- Dropped three dead `jest.mock("@app/components/contact-modal", …)` calls
  and the comment claiming the specs assert on them; app-update.tsx no longer
  imports that module at all.

- The app.tsx wiring specs match formatting-tolerant regexes instead of exact
  source text, so adding a prop or letting prettier wrap a tag no longer fails
  a spec while the mount is intact.

- New app-update-inline-modal.spec.tsx runs the real react-native-modal (every
  other spec stubs it wholesale) and pins that coverScreen={false} keeps the
  gate off the native modal host — broken under Fabric on Android, see #545 —
  with content rendered and both escapes tappable. Verified it fails when the
  prop is dropped. Fabric layout still needs a device check before release.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
@linear

linear Bot commented Aug 20, 2026

Copy link
Copy Markdown

ENG-551

@bobodread876

Copy link
Copy Markdown
Collaborator Author

Pre-release device check — Android New Architecture (blocking for the release build that carries this)

Review finding: every spec mocks react-native-modal wholesale, so coverScreen={false} (the #545 workaround) was only ever asserted as a prop value. Nothing exercised the library's inline render path, and nothing can exercise it at app-root position under Fabric — jest has no layout engine, and the wrapper's position: absolute box resolves against a different ancestor here than it does for the existing coverScreen={false} caller (contact-modal.tsx:121, which renders from inside a screen). If it measures wrong at this position, every hard-blocked user gets a blank frozen screen with no in-app recovery — the exact outcome this PR exists to prevent.

What was automated (__tests__/components/app-update-inline-modal.spec.tsx, new in d32d4d0): runs the real react-native-modal and pins that the gate stays off the native modal host, that the block's content renders, and that both escape buttons are tappable on the inline path. Verified it fails when coverScreen is flipped to true. That closes the "asserted only as a prop value" gap but says nothing about Fabric layout.

What still has to happen on a device before this ships in a release build:

  1. Physical (or emulated) Android device with the New Architecture enabled, running a release-configured build of this branch.
  2. Point the app at an API returning minSupported above the local build number so the gate engages for real.
  3. Confirm, and note the result on this PR:
    • the modal renders full-screen — content is not pushed off-screen by the bottom-pinned versionComponent spacer
    • "Tap here to update now" is tappable and reaches the store
    • "Contact Support" is tappable and opens the mail composer
    • the hardware back button does nothing (the gate must swallow it)

If any of these fail, the fix is layout inside AppUpdateModal, not reverting to the native host — coverScreen={true} is what #545 breaks.

The "tells support the blocked device is on Android" case installed no
spy of its own — it read `(Linking.openURL as jest.Mock).mock.calls`,
inheriting whatever the preceding test left behind. Two tests inserted
above it flipped that inherited mock from `mockResolvedValue(undefined)`
to `mockRejectedValue(...)`, so the case was silently exercising the
mail-composer *failure* path while its name claimed the success path,
and it would break outright if the file were reordered.

Give it its own `jest.spyOn(Linking, "openURL").mockResolvedValue(...)`,
wrap the press in `act` like every sibling case, assert against that
spy's calls, and add an assertion that the last-resort address stays
hidden — which is what pins the case to the success path regardless of
what runs before it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
@islandbitcoin
islandbitcoin merged commit 906040f into main Aug 20, 2026
10 checks passed
bobodread876 pushed a commit that referenced this pull request Aug 24, 2026
Breez is retiring Spark SDK versions older than 0.17, and every installed
Flash build ships 0.13.6 — when retirement lands, BTC wallets break in
place for anyone who has not updated. This is the upgrade half; the
fleet-protection half (version gate raise + push campaign for <=0.6.6
users, who have no gate UI) rides separately and sequences off the
retirement date.

Target 0.22.3, not 0.17.x (landing just above the cliff re-runs this
whole exercise within a quarter at Breez's 1-2 week minor cadence) and
not 0.23.0 (one day old, no soak). Pinned EXACT — the caret is what let
a pre-1.0 money dependency float silently; range ^0.13.4 resolving to
0.13.6 is how nobody noticed being four months behind.

The migration surface, from a typings-verified read (both versions
installed, .d.ts diffed — release notes alone MISSED the biggest one):

- PrepareSendPaymentRequest.paymentRequest: string -> PaymentRequest
  tagged union. All four call sites wrap the raw string in
   — the Input variant is parsed
  internally exactly as the bare string was, so semantics are unchanged.
- SdkEvent_Tags.Optimization -> AutoOptimization (0.17.0 rename).
- SendPaymentMethodLike: 0.22.x adds variants (CrossChainAddress) whose
  inner shares NO properties with the fee fields, which breaks structural
  assignability of the union as a whole.  is now opaque at the
  type level; each tag branch narrows to the fields that variant
  actually carries. Behavior identical.
- Jest mock: AutoOptimization rename + PaymentRequest.Input constructor.
  The feared enum-numbering drift was checked and REFUTED — numeric
  enums are byte-identical between 0.13.6 and 0.22.3.

Not verifiable from typings, and therefore the RELEASE GATE for v0.6.8:
a physical-device BTC regression — send (LN/onchain/LNURL), receive
(invoice/onchain), swap both directions, deposit claim/refund — same
bar #701 set for the New Arch. Native side vendors inside the npm
package; CI's build checks + update_pods own the Podfile.lock.

87 suites / 861 tests green; tsc and eslint clean.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV
islandbitcoin pushed a commit that referenced this pull request Aug 25, 2026
* feat(breez): Spark SDK 0.13.6 -> 0.22.3, pinned exact (ENG-563)

Breez is retiring Spark SDK versions older than 0.17, and every installed
Flash build ships 0.13.6 — when retirement lands, BTC wallets break in
place for anyone who has not updated. This is the upgrade half; the
fleet-protection half (version gate raise + push campaign for <=0.6.6
users, who have no gate UI) rides separately and sequences off the
retirement date.

Target 0.22.3, not 0.17.x (landing just above the cliff re-runs this
whole exercise within a quarter at Breez's 1-2 week minor cadence) and
not 0.23.0 (one day old, no soak). Pinned EXACT — the caret is what let
a pre-1.0 money dependency float silently; range ^0.13.4 resolving to
0.13.6 is how nobody noticed being four months behind.

The migration surface, from a typings-verified read (both versions
installed, .d.ts diffed — release notes alone MISSED the biggest one):

- PrepareSendPaymentRequest.paymentRequest: string -> PaymentRequest
  tagged union. All four call sites wrap the raw string in
   — the Input variant is parsed
  internally exactly as the bare string was, so semantics are unchanged.
- SdkEvent_Tags.Optimization -> AutoOptimization (0.17.0 rename).
- SendPaymentMethodLike: 0.22.x adds variants (CrossChainAddress) whose
  inner shares NO properties with the fee fields, which breaks structural
  assignability of the union as a whole.  is now opaque at the
  type level; each tag branch narrows to the fields that variant
  actually carries. Behavior identical.
- Jest mock: AutoOptimization rename + PaymentRequest.Input constructor.
  The feared enum-numbering drift was checked and REFUTED — numeric
  enums are byte-identical between 0.13.6 and 0.22.3.

Not verifiable from typings, and therefore the RELEASE GATE for v0.6.8:
a physical-device BTC regression — send (LN/onchain/LNURL), receive
(invoice/onchain), swap both directions, deposit claim/refund — same
bar #701 set for the New Arch. Native side vendors inside the npm
package; CI's build checks + update_pods own the Podfile.lock.

87 suites / 861 tests green; tsc and eslint clean.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV

* fix(breez): throw on unrecognized payment method tags, complete SdkEvent_Tags mock

Review fixes for PR #710:

- fee-extraction: an unrecognized SendPaymentMethod tag (e.g. the
  CrossChainAddress variant 0.22.x added to the union) now throws instead
  of silently rendering a 0-sat fee that skips the amount+fee balance
  check — same failure mode the BitcoinAddress no-quote branch already
  throws on. Callers classify the throw as an "sdk" fee error via
  classifyBreezSdkError. undefined paymentMethod still returns 0.
  Updated the spec that enshrined the silent-zero behavior.

- mock: SdkEvent_Tags was missing four real 0.22.3 members
  (UnclaimedDeposits, ClaimedDeposits, LightningAddressChanged,
  NewDeposits). Added them, plus a parity spec that pins every mock
  member/value to the installed package's generated d.ts so future
  drift fails loudly.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV

* test: pin PaymentStatus, PaymentType, PaymentRequest_Tags in mock parity spec

Review fix for PR #710: the parity spec only pinned SdkEvent_Tags, leaving
the numeric enums (PaymentStatus, PaymentType) — the ones that previously
drifted destructively — and the new PaymentRequest_Tags unguarded. The
member regex now captures numeric values as well as string values, and the
spec asserts all four mocked enums against the generated d.ts. Also fail
loudly if an enum block matches zero members.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV

* fix(ios): regenerate Podfile.lock for BreezSdkSparkReactNative 0.22.3

Review fix for PR #710: the committed lockfile still pinned 0.13.6 while
package.json ships 0.22.3 — update_pods.yml only triggers on dependabot
branches, so nothing would ever regenerate it. Ran pod install on this
branch so the repo's record matches the shipped native version.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NEoz7nBtdtsHyuYG5wNPQV

---------

Co-authored-by: Dread <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>
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