Skip to content

[Due for payment 2026-09-30] Expense - No page count on multi page PDF receipt when created from split scan expense #100350

Closed

Description

@applause-bot

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: 9.4.70-0
Reproducible in staging?: Yes
Reproducible in production?: N/A - new feature, doesn't exist in prod
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #97813
Email or phone of affected tester (no customers): jsdoijnodsdisojo@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Mac 26.5 / Chrome
App Component: Workspace Settings

Action Performed:

  1. Go to staging.new.expensify.com
  2. Open 1:1 DM with any user.
  3. Create a split scan expense with multi page PDF receipt.
  4. Open the split preview.
  5. Click Show more.
  6. Click Amount.
  7. Enter amount and save it.
  8. Open split preview.
  9. Open the expense report.

Expected Result:

Page count will show on the receipt on split details page and expense report.

Actual Result:

Page count is not shown on the receipt on split details page and expense report.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7250456_1788462451444.3.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7250456

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    DeployBlockerCashThis issue or pull request should block deployment
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 3, 2026
  2. applause-bot commented on Sep 3, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/2d08f1d14b18c50dc70d25a9995bacd4d79ee39ff27098d6d5c676a296c53725

  3. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #97813

  4. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @MonilBhavsar @abzokhattab you have been assigned to this deploy blocker because you reviewed the offending PR: #97813

  5. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    @ishpaul777 you have been assigned to this deploy blocker because you authored the offending PR: #97813

  6. melvin-bot commented on Sep 3, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  7. github-actions commented on Sep 3, 2026

    @github-actions
    Contributor

    👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

    1. Identify the pull request that introduced this issue and revert it.
    2. Find someone who can quickly fix the issue.
    3. Fix the issue yourself.
  8. MelvinBot commented on Sep 3, 2026

    @MelvinBot
    Contributor

    Issue Analysis

    Root Cause: #97813 (the auto-assigned PR) is correct — but it's not a small miss. The page-count badge only exists in one component, and the split flow misses it in two independent ways:

    1. Split details page — the badge isn't rendered there at all. DynamicSplitBillDetailsPage shows the receipt via ConfirmationReceiptThumbnail.tsx:134-180, which has no Badge. That file isn't in [Payment due @abzokhattab] Show a page count badge on multi-page PDF receipts #97813's diff, so the badge is structurally unreachable on the split preview.
    2. Expense report — pageCount is stripped from the split's child transactions. buildOptimisticTransaction rebuilds receipt from a four-field whitelist (source, filename, state, isTestDriveReceipt). pageCount isn't in it, so receiptPageCount falls back to 0 and the > 1 gate at MoneyRequestReceiptView.tsx:560 never passes.

    Recommended Fix: revert #97813.

    That PR is the sole cause of three of the four open deploy blockers on this checklist:

    Blocker Symptom
    #100350 (this one) Badge never appears for split scan expenses
    #100336 Stale badge persists after a distance receipt drops to one page
    #100342 Badge covers the Mapbox logo while a distance receipt regenerates

    The feature is cosmetic and brand new, so nothing in production depends on it, and #97813 is the last PR to touch every file it changed — the revert is clean. Patching three lifecycle gaps under deploy-blocker time pressure is the riskier path.

    If you'd rather roll forward

    Two client-side changes are needed for this blocker only:

    1. Add pageCount to the receipt literal in TransactionUtils/index.ts:563-565, or spread the incoming receipt instead of whitelisting fields.
    2. Render the badge in ConfirmationReceiptThumbnail.tsx, or explicitly scope the split details page out of the feature.

    Unverified: whether the backend's CompleteSplitBill propagates pageCount onto the server-created child transactions. Even with both changes, that needs confirming. And neither change touches #100336 or #100342.

    Supporting evidence
    • [Payment due @abzokhattab] Show a page count badge on multi-page PDF receipts #97813 merged 2026-09-03 18:04 UTC, ~90 min before this blocker was filed at v9.4.70-0.
    • Its diff adds pageCount to the Receipt type and updates Receipt.ts, MergeTransaction.ts, DebugUtils.ts and MoneyRequestReceiptView.tsx — but not src/libs/TransactionUtils/index.ts.
    • grep -rn "pageCount" src/libs src/components shows the only consumer of receipt.pageCount is MoneyRequestReceiptView.tsx:203; no other receipt-rendering component reads it.
    • completeSplitBill does pass the full receipt through at Split.ts:1104 — the field is lost downstream in buildOptimisticTransaction, not at the call site.
    Proposed AI code review rule (for maintainer review)

    Repo: Expensify/App — CONSISTENCY-19: Propagate new Onyx model fields through every explicit-field rebuilder.

    Condition: When a PR adds a property to a type under src/types/onyx/, every function that returns that model as an object literal with an explicit field list (rather than spreading the source) must copy the new property too — otherwise the field is silently dropped from optimistic data.

    Why: buildOptimisticTransaction rebuilds receipt from a four-key whitelist, so the newly added receipt.pageCount never reached split-created transactions and the feature silently did nothing in that flow.

    Detection: for each property added under src/types/onyx/, run rg -n "<propName>" src/libs src/components and confirm it appears in every buildOptimistic* / getUpdated* function returning that model.

    Not created — a maintainer can open it as a draft PR under .claude/skills/coding-standards/rules/.


    Next Steps for Contributor+ team:
    To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/100350) to create a draft PR.
    To refine: @MelvinBot <your feedback>
    To reject: Explain why you are rejecting Melvin's proposal.


    view run · no recording available

  9. 12 remaining items

  10. changed the title [-]Expense - No page count on multi page PDF receipt when created from split scan expense[/-] [+][Due for payment 2026-09-30] Expense - No page count on multi page PDF receipt when created from split scan expense[/+] on Sep 23, 2026
  11. abzokhattab commented on Sep 23, 2026

    @abzokhattab
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: new feature

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A — new feature

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Precondition:

    • A multi-page PDF receipt (2+ pages).

    Test:

    1. Open a 1:1 DM with any user.
    2. Create a split scan expense using the multi-page PDF receipt.
    3. On the split confirmation screen, verify the "Page 1 of N" badge appears on the receipt thumbnail.
    4. Complete the split (enter amounts, save).
    5. Open the split preview, then open one of the resulting individual expenses.
    6. Verify the "Page 1 of N" badge shows on the expense's receipt with the correct page count.
    7. Open an expense created from a single-page PDF split and verify no badge appears.

    Do we agree 👍 or 👎

  12. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Sep 29, 2026
  13. melvin-bot commented on Sep 29, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  14. melvin-bot commented on Sep 29, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  15. mallenexpensify commented on Oct 1, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @abzokhattab due $250 via NewDot

    Don't think this is a blocker though there was no badge here before #97813 either, so reverting wouldn't restore anything, it'd just remove a badge that never existed for splits.

    Paid 100% cuz, from @ishpaul777 's comment, it sounds like the bug pre-existed the PR. Comment/reopen if any disagrees

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2Engineering

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions