Instrument Android checkout failures - #676
Conversation
c4a1ff0 to
f8749f0
Compare
0bdb099 to
da2ae5b
Compare
f8749f0 to
8a67b38
Compare
da2ae5b to
0611c9e
Compare
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Package Size
Android file breakdown
Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report. |
Install this buildOpen Tophat, select your target device, then click Install. Links open on the Mac running Tophat.
Checkout Kit E2E results
|
| ProtocolClient().onDecodeError { method, error, params -> | ||
| log.e(LOG_TAG, "Failed to decode $method params", error) | ||
| log.d(LOG_TAG, "Raw $method params: $params") | ||
| CheckoutTelemetry.recorder.recordProtocolDecodeError( |
There was a problem hiding this comment.
The PR description mentions matching the cross-platform decode taxonomy, which made me wonder whether the counts match across platforms too, not just the labels. an AI review pass flagged this spot, and I traced it through the diffs to check.
Since this hook is built into every CheckoutProtocol.Client, the count seems to depend on how many clients process a message, rather than on the inbound message itself. Two cases I wanted to sanity-check:
- if a merchant registers an ec.complete handler, AlwaysRunAfterMerchant means a malformed payload can be decoded by both the merchant client and the kit default client, so it looks like it records twice
- if ec.error arrives with a valid envelope but malformed params and there's no merchant subscriber, it looks like no handler decodes it, and the terminal-error path decodes it separately without recording a params decode error, so it records zero
So the question is: is this metric meant to count failed decode attempts by clients (which is what it does today), or malformed messages from checkout (which is what the name suggests to me)? If it's the latter, should it record once per message in EmbeddedCheckoutProtocolBridge, where each message is first decoded?
There was a problem hiding this comment.
You read it right — the contract says undecodable messages, so per-client counting was wrong on both edges. The bridge now records once per message, and the terminal ec.error path records even with no subscribers; both have regression tests. iOS had the same ec.error gap (fixed in #675), web already counts per message.
8a67b38 to
af4ddda
Compare
0611c9e to
4478383
Compare

Summary
react-native-androidas the platform when embedded in React Native,androidotherwiseenvelopeand params decode failures recordparamsec.errorwith undecodable params records even when nothing subscribes to itValidation