Business · Product · Technology · AI

Verify card-cache recovery, refusals and local wallet state

Seven pinned and five supplemental JVM cases exercise selected stale fallback, warm-cache refusals, sequential mode separation, QR re-read, local wallet overlay and direct temporary-cache wipe.

Work directly with Omer Muneer Qazi · Reviewed 30 November 2026

Need this built or fixed for your business?

Work directly with me on a technical review, an implementation, or a migration. Start with the business outcome and the engineering problem in front of your team.

  • Review the architecture, constraints and delivery risks.
  • Define the implementation scope and acceptance checks.
  • Build and verify the agreed changes.

Send your current platform, blocker, desired outcome and timeline.

Hire Omer for a similar project ↗

The scenario: offline continuity needs defined refusal and state boundaries

A card repository can improve continuity by returning a cached list during a selected network failure. It also needs explicit behavior when there is no cache, a service refuses a request, the app changes modes or the cache is wiped. A local wallet flag adds another distinction: client state can describe a previous action without proving a provider currently holds a pass.

This chapter combines seven existing pinned Android JVM cases with five supplemental research cases. All use synthetic service delegates, a fixed clock, software-key file protection and isolated temporary files. Both default-mode and demo-mode delegates are synthetic in these tests. No actual HTTP client, patient record, wallet issuer, Android Keystore, application sign-out or device is exercised.

Retain the original cases and identify the added questions

The retained seven-case JUnit report is checked against its source and digest before reuse. The original test and six relevant implementation files are compared with pinned Git content. The five supplemental cases are a separate research-only file in the isolated JVM runner; the repository implementation remains unchanged.

Execution uses offline cached dependencies, two workers and an allowlisted environment without signing variables. The test JVM's temporary-directory argument points to HDD scratch storage. The receipts identify the exact cases and inputs, rather than inferring execution from a test declaration or a build's success. The seven retained cases are counted once with this publication, not as a new rerun.

Observe a stale fallback only with the selected cached data

An existing case first obtains a successful synthetic card response, then supplies a network exception. A new repository instance reads the selected disk cache and returns the supplied collection with its stale flag set. The same software-key helper is shared across those repository instances within that test.

This is a same-process re-read, not an operating-system restart or Android Keystore recovery. The test does not expire a server session, revoke a real record or measure freshness against an authoritative service. The stale flag identifies a selected fallback path. It does not certify that every cached field remains current or authorized for every later viewer.

Refuse selected failures when a cache cannot supply an accepted result

Another existing case supplies a network failure without priming a cache and observes the failure. The missing-route case supplies a selected not-found exception and observes the repository's unavailable classification. These are controlled exception inputs, not requests to a deployed route.

The supplemental cases then repeat the refusal questions with a warm cache. A selected forbidden exception is propagated rather than replaced by a stale success. A selected missing-route exception still receives the unavailable classification despite cached data. This exercises boundaries that a happy-path offline example would miss, while leaving actual authentication and server-response correctness independently verifiable.

Keep service selection, memory identity and disk identity together

The existing demo case observes a demo result and the selected demo-cache filename instead of the default filename. A supplemental case deepens that boundary by switching one repository between two distinct synthetic delegates. Their returned card identifiers carry different invented markers, making an accidental reuse of the other mode's collection visible.

The case primes both modes, then makes both delegates fail with selected network exceptions. Switching modes returns the corresponding cached marker and stale/demo flags. Both selected cache paths exist. This is sequential mode-switch evidence, not a concurrent access or account-isolation guarantee. No real clinic or user identity is changed, and the markers represent only the supplied synthetic delegates.

Treat cache filenames and software keys as fixture details

The repository's selected cache files are passed through the pinned SecureFiles helper. The tests explicitly supply its software-key path; the actual Android Keystore branch is not used. A normal file read succeeds under the retained test key and supplies bytes to the current JSON model.

The filename extension does not by itself describe the stored representation, and these cases do not establish cryptographic design, hardware protection or every write-failure outcome. Separate cache-crypto chapters cover selected envelope and refusal cases. This chapter adds repository-state evidence under normal temporary-file operations, with key custody and deployed storage configuration left outside its scope.

Re-read cached QR metadata without declaring the credential valid

The retained QR case begins without a selected cached token, refreshes through the synthetic service and reads the same result through another repository instance. It also checks the fetched-time value against the fixed clock. This establishes a selected metadata and persistence handoff within the fixture.

It does not scan the token, verify a server signature, wait for expiry or prove that a viewer enforces the intended validity rules. The source's cached-token accessor and the consumer's eligibility decision are different boundaries. A successful re-read is evidence that the selected object can be recovered, not that it remains a valid real credential.

Distinguish a local wallet overlay from the delegate's response

An existing case marks a synthetic card locally and observes its selected wallet flag on a subsequent repository result. The supplemental persistence case creates a new repository instance with the same test directory and software key. Its result still carries the selected local overlay even while the synthetic service's own response remains unmarked.

This makes the source of the displayed state explicit. The test does not issue a wallet pass, save it through a native provider or prove that the server acknowledged an installation. It also does not exercise every later server-state transition. A local overlay is useful client-state evidence, while reconciliation with an actual issuer and repository consumer needs its own acceptance.

Verify selected wipe outcomes at both repository lifetimes

The retained wipe case removes the selected temporary cache directory and observes a cache miss through another repository instance. The supplemental case tests the same repository object after its direct wipe call, then supplies a network failure. The old collection is not recovered as a stale success, and the selected cache directory remains absent.

Those assertions concern the supplied directory and in-memory repository state. They do not run an application sign-out callback, erase backups or establish deletion across every storage surface. The case names should not enlarge the observed result into a global erasure guarantee. No actual user cache or medical record is removed during this research.

Leave crash, concurrency and native lifecycle acceptance explicit

These cases use normal temporary-file operations and awaited repository calls. They do not interrupt a write, exhaust storage, change keys across processes or race a mode switch against an in-flight response. The fixed test clock also differs from a device clock and a remote credential authority.

The next integration should define the intended behavior for those boundaries, then verify the relevant application wiring with synthetic records under explicit permission. The inspected factory's sign-out registration and native UI consumers remain source context. They are not executed merely because a direct repository wipe, cache read or local flag assertion passes.

Handover for card-cache and wallet-state maintenance

Retain the seven original and five supplemental case names, source hashes, software-key fixture boundary and JUnit reports. The new publication-backed evidence covers selected stale fallback, warm-cache refusals, sequential mode separation, QR re-read, local wallet overlay and direct wipe behavior. Other cache suites and APK inspections are not recounted.

For an engineering handover, the result is a concrete distinction between recovered bytes, a stale collection, a propagated refusal, a local overlay and provider acceptance. Current server authorization, credential validity, Android key recovery, application lifecycle, clinical suitability and distributed-app behavior remain unverified here. The repository tests make those next acceptance steps more precise without presenting a synthetic cache path as a complete medical-wallet workflow.

Compare the reviewed boundaries

Selected repository outcomes have different meanings

On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.

Fixture boundaryObserved outcomeSeparate acceptance
Cached list plus selected network errorStale collection recoveredCurrent authorization and freshness
Warm cache plus selected forbidden / missing routeRefusal propagated / unavailable classificationActual server response and UI handling
Sequential default/demo mode switchingCorresponding marked collection and cache pathConcurrent mode/account changes
QR cache re-readSelected object and fetched time recoveredCredential validity and expiry enforcement
Local wallet overlay re-readLocal flag survives while delegate stays unmarkedIssuer save and reconciliation
Direct wipeSelected temporary cache absent; old collection not recoveredApplication sign-out, backups and global erasure

About this engineering series

Written by Omer Muneer Qazi from a review of Movo-X implementation and dated engineering records. This article explains source behaviour and historical observations; current production, clinical outcomes and store availability require their own verification. Examples are synthetic and proposed test cases are identified as such.

Explore the Movo-X engineering series → · Related implementation experience →

Discuss a similar engineering problem

Send the workflow, current platform and the decision your team needs to make. I can help define an implementation or review scope with concrete acceptance evidence.

Discuss your project on WhatsApp ↗
WhatsApp Omer about this project ↗