The scenario: acknowledging a result and consuming an event are different steps
A native result bridge can recognize an activity request code without proving that the intended screen consumed its outcome. Subscription timing, pending state and lifecycle are additional boundaries. This chapter extends the pinned wallet helper's earlier scalar mapping cases with three supplemental JVM research cases that actually subscribe to its coroutine flow.
The controlled tests observe mapped outcomes reaching an active collector, an unrelated request not producing an event and an acknowledged result emitted before subscription not being replayed to the new collector. No wallet provider, Android activity, Compose screen, patient record or server is involved. The result makes a local event-delivery contract precise while preserving the native workflow still to accept.
Exercise the pinned helper instead of a copied event-bus implementation
The supplemental file is added only to the isolated archived JVM runner. It calls the original pinned GoogleWalletResults helper and its exposed flow. The helper and model-enum sources match their pinned hashes. The research test source has its own digest and three unique method names, separate from the existing seven mock/model cases.
The selected run uses offline cached dependencies, two workers and a controlled coroutine test scheduler. The pinned version catalog declares coroutines 1.10.2. The JUnit receipt records three research cases without failures, errors or skips. No provider client is constructed and no real result callback arrives from an activity. This is a subscriber test of the helper, not a simulated success from a wallet service.
Start the collector before emitting selected mapped outcomes
The first case launches an active collector with the controlled dispatcher, then calls the helper with the selected wallet request code and success, cancellation and other result values. After advancing the test scheduler, the collected list contains the selected saved, cancelled and failed outcomes in order.
The helper's boolean acknowledgement is checked as well, but the collected list is the additional evidence missing from scalar mapping alone. These observations concern the supplied three values and this active subscriber. They do not establish every concurrent producer, buffer-overflow condition or UI consumption path. The test closes its collector explicitly so another case does not inherit a live subscription.
Use a positive control after the unrelated-request check
The second case subscribes first and supplies an unrelated request code. The helper declines it, and the received collection remains empty at the controlled scheduler checkpoint. The case then delivers a selected matching cancellation result and observes that outcome arriving at the same collector.
That later event acts as a positive control: an empty collection after the unrelated request is not accepted merely because the collector never started. The case still does not invoke Activity.onActivityResult or validate how a real activity dispatches request codes. It establishes the helper's selected recognition and event behavior when called directly in the JVM fixture.
Observe the event-before-subscription boundary
The third case delivers a matching success result before launching the new collector. The helper acknowledges the request. After the collector starts and the scheduler runs, it has not received that earlier event. A subsequent selected cancellation result does arrive, again confirming that the collector is active for later events.
This is a concrete timing observation, not a diagnosis of a live lost-result incident. The test does not recreate screen rotation, process death, foreground/background transitions or an actual provider callback. It distinguishes an acknowledgement from durable history for this selected sequence. Any workflow requiring recovery across a subscription gap needs its own explicit requirement and acceptance evidence.
Keep replay storage apart from extra buffering
The pinned helper creates a mutable shared flow with selected extra buffer capacity and exposes a read-only flow. Kotlin's primary SharedFlow documentation describes replay storage and additional buffering as separate concepts. That distinction provides context for interpreting the early-event case without treating extra capacity as a promise of later replay.
The linked documentation is current API context; the execution receipt remains tied to the pinned dependency version and helper source. No library upgrade or event-bus configuration change is made. The research does not exhaust buffer capacity, stall a subscriber or test overflow policy under load. Those are different cases from the selected no-subscriber and active-collector sequences exercised here.
Separate request acknowledgement from emission and rendering guarantees
The helper acknowledges a recognized request after its selected emission call. The early-event case shows why that return value alone does not certify later consumption. The active-collector case adds observed delivery under controlled conditions, but still stops before application state changes or rendered feedback.
A complete handover should name each intended acceptance point: request recognized, outcome offered, intended consumer active, relevant attempt selected, record state reconciled and user feedback observed. These tests cover only selected points in that chain. They do not certify durable recording, exactly-once processing or a successful wallet save at the provider.
Trace the Compose consumer as source-only context
The inspected WalletFlow source collects these outcomes in a launched effect. It checks whether pending card identifiers exist before applying its selected saved/failed/cancelled handling. The same source also contains a separate browser-return lifecycle path. Those statements help locate the next integration boundary, but none is executed by the three JVM cases.
An active generic collector is therefore different from the intended Compose consumer handling the right save attempt. Recomposition, pending-state changes, activity results, browser returns and repository updates need permitted native acceptance. This chapter does not infer an error from their absence in the current fixture, and it does not change the product's result-handling design.
Make the scheduler and cleanup part of the receipt
The tests use the coroutine test scheduler rather than wall-clock sleeps. Each collector is cancelled and joined in cleanup. Selected request/result values and collected lists are retained in the research source, while the JUnit report identifies the executed methods. That makes the observations repeatable and their lifetime boundaries visible.
The controlled schedule is also a limit. It does not establish behavior for every thread interleaving, slow collector or process lifecycle. A stress or device test should describe its own scheduling and observation points rather than borrowing confidence from these deterministic examples. No performance, latency or provider-delivery benchmark is claimed.
Handover for native wallet-result acceptance
Retain three supplemental case names, pinned helper/model hashes, the research test digest and its JUnit report. Keep them separate from the seven existing mock/model cases and from uncounted APK inspection observations. Their contribution is a tested distinction between selected acknowledgement, active consumption and later subscription.
The next acceptance should connect an authorized synthetic wallet attempt to the actual activity or browser path, intended consumer state and repository reconciliation on a permitted device. Current issuer readiness, provider save, rendered success, clinical suitability and distributed-app behavior remain unverified here. The JVM evidence gives that integration a precise starting contract without presenting an event-bus observation as a completed native wallet workflow.
Compare the reviewed boundaries
Acknowledgement and consumption have different evidence
On smaller screens, scroll across to compare every column. Keyboard users can focus the table and use the arrow keys.
| Selected sequence | Observed in JVM | Separate acceptance |
|---|---|---|
| Active collector then matching results | Selected saved/cancelled/failed outcomes arrive | Real activity callback and intended UI state |
| Active collector then unrelated request | Request declined; no event; later positive control arrives | Every request dispatch path |
| Matching result before subscription | Acknowledged; new collector sees only later event | Lifecycle gaps / required recovery contract |
| Compose pending-state consumer | Source reviewed only | Attempt identity, repository update and rendered feedback |
Additional implementation references
These provider references explain current implementation context. Historical Movo-X observations remain tied to the source records described above.
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 ↗