Add Share Extension receipt telemetry: stamp trace id, log capture and submit milestones#59
Closed
adhorodyski wants to merge 1 commit into
Closed
Add Share Extension receipt telemetry: stamp trace id, log capture and submit milestones#59adhorodyski wants to merge 1 commit into
adhorodyski wants to merge 1 commit into
Conversation
…d submit milestones Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Collaborator
Author
|
Reopening against Expensify/App instead. See the new PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the receipt capture-to-upload telemetry from Expensify#94950 to receipts that enter through the iOS Share Extension (print an email, Share, Expensify, Save).
Why
The trace id was minted in only two places:
buildReceiptFiles.ts(camera, gallery, file) andreplaceReceiptinReceipt.ts. The share flow goes through neither. It builds the receipt by hand inSubmitDetailsPage.onSuccessand callsrequestMoney/trackExpensedirectly, so it also skipscreateTransaction, where thesubmittedmilestone fires.For a shared receipt this meant:
capturedlog never fired, so we lostmimeType,fileExtension, andfileSizeBytes. That is the PDF-format and large-file signal we care about.submittedlog never fired, so we lost the draft to finaltransactionIDmapping.Only
enqueuedand the queuesnapshotstill fired, both withreceiptTraceId: undefined, joinable only bytransactionID. This is the exact variant confirmed lost in production.Changes
'share'to theReceiptCaptureSourceunion inReceiptObservability.ts.SubmitDetailsPage.onSuccess, stamp the receipt with a trace id and log the capture milestone withcaptureSource: 'share'. The file read from disk carries its type, name, and size, so the capture log gets the format and size fields.SubmitDetailsPage.finishRequestAndNavigate, log the submit milestone with the draft and final transaction ids right before the directrequestMoney/trackExpensecall.The stamp makes
enqueuedandsnapshotcarry a real trace id. The two log calls restore thecapturedandsubmittedmilestones, so a shared receipt has the same end-to-end trace as a camera or gallery receipt.Tests
Added a test in
SubmitDetailsPageTest.tsxthat drives a share submit and checks the trace id reaches the request receipt, and that thecapturedandsubmittedlines fire with sourceshare. The existingReceiptObservabilityunit tests already cover the shared helpers.Related