Skip to content

[Due for payment 2026-09-14] Page count is shown and blocks Mapbox when new receipt is generating after editing distance #100342

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: Money Requests

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Create a map distance expense with many waypoints so that the receipt has more than 1 page.
  4. Open the expense.
  5. Click Distance.
  6. Edit the distance and save it.

Expected Result:

Page count will be hidden when new receipt is generating after editing distance.

Actual Result:

Page count is shown and blocks Mapbox logo when new receipt is generating after editing distance.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug7250437_1788461530594.1.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Svetlana Lazutkina
Bug ID: 7250437

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/b4e78e68a339212acc80426784db5c3fa5150295f563e71772d7d1c9616295ba

  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. 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.
  7. melvin-bot commented on Sep 3, 2026

    @melvin-bot

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

  8. MelvinBot commented on Sep 3, 2026

    @MelvinBot
    Contributor

    🔍 Investigation Summary

    Classification: Frontend bug
    Causing PR: #97813 - "Show a page count badge on multi-page PDF receipts" by @ishpaul777 (High confidence)
    Related Issues: #100332 (StagingDeployCash — PR #97813 is line item 26)

    Recommendation: ROLL FORWARD

    The badge's visibility condition is missing the one guard the rest of that file already uses (isPendingReceiptRegeneration), so this is a one-line fix in a single expression. A revert would tear out an entire feature (badge + 11 language files + styles + Onyx type + unit tests) whose backend counterpart is already deployed, to fix a stale-overlay condition.

    Suggested fix — MoneyRequestReceiptView.tsx:560:

    // Show the count badge only after a multi-page PDF receipt loads. While a distance receipt is regenerating the
    // container swaps the PDF for a live map, which has no pages and whose Mapbox logo sits in the same corner.
    const shouldShowReceiptPageCount = receiptPageCount > 1 && Str.isPDF(receiptURIs?.filename ?? '') && !isLoading && !isPendingReceiptRegeneration;

    isPendingReceiptRegeneration is already computed at line 194 and is the same guard behind canShowDistanceEReceipt (L197), shouldDisableExpandReceipt (L200), and canHoverZoomReceipt (L299), so no new state is needed.

    Worth covering the sibling case in the same fix: ReportActionItemImage.tsx:145 also substitutes the map when the transaction has route/waypoint errors (hasErrors), which strands the badge over a map the same way.

    Assigned: @ishpaul777 (PR author), @MonilBhavsar and @abzokhattab (approving reviewers) from PR #97813 — already assigned by Melvin
    Labels: No changes. DeployBlockerCash stays (an App PR caused this and the fix is in App). DeployBlocker was never applied, so nothing to remove.

    📋 Detailed Analysis

    Evidence

    Verification

    Affected files, all touched by PR #97813 except the last two, which explain the interaction:

    Confirmed with gh pr view 97813 --json files: the PR modifies MoneyRequestReceiptView.tsx, src/styles/index.ts, src/types/onyx/Transaction.ts, src/libs/actions/IOU/Receipt.ts, src/libs/actions/MergeTransaction.ts, src/libs/DebugUtils.ts, the 11 language files and one new test file. Nothing else in the repo reads receipt.pageCount.

    Root Cause

    Saving a distance edit writes a pending action onto the transaction's pendingFields. hasPendingDistanceReceiptRegeneration turns true, so ReportActionItemImage stops loading the now-stale receipt URL and renders a live ConfirmedRoute map instead. The receipt box is therefore showing a Mapbox map, not a PDF.

    The page-count badge, however, is rendered as a sibling of that image (deliberately, so hover-zoom doesn't scale it), and its condition only asks three things: receiptPageCount > 1, Str.isPDF(receiptURIs?.filename) and !isLoading. All three still hold during regeneration:

    • receipt.pageCount is untouched by the distance edit — nothing resets it the way replaceReceipt resets it to null in Receipt.ts:213.
    • receiptURIs.filename still points at the stale PDF, so Str.isPDF is still true.
    • isLoading was already false from the pre-edit render, and the component doesn't remount, so it stays false.

    So the badge keeps rendering with the old PDF's page count, absolutely positioned at bottom-left, directly on top of the Mapbox logo at bottom-left of the substituted map. It is both wrong (the map has no pages) and it obscures the Mapbox attribution logo, which is why this is more than cosmetic.


    view run

  9. 13 remaining items

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

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  12. melvin-bot commented on Sep 13, 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
  13. mallenexpensify commented on Sep 16, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    Nothing is due on this issue. Not $250. abzokhattab approved the offending PR twice, so this regression came from a PR he reviewed.

    Offending PR #97813 by ishpaul777, merged 2026-09-03. 18 files, +130 / -1
    Fix PR #100357 by ishpaul777, merged 2026-09-04. 4 files, +111 / -1
    Contributor Nothing due. ishpaul777 authored the offending PR, and he is a Backend Contributor
    Contributor+ Nothing due. abzokhattab approved the offending PR on 2026-08-14 and approved it again on 2026-09-01
    Job price $250, standard, no price in the title
    Melvin proposed $250 to abzokhattab
    Rule 0%: the regression came from the payee's own PR
    Precedent #98833, the same shape. Melvin proposed $250 each and Matt paid $0
    Contributor+ checklist None posted. Melvin asked on 2026-09-07 and nagged on 2026-09-10
    Needs a ruling Only if abzokhattab appeals. The counterargument is below
    Why nothing is due

    Melvin named the reviewers itself: "@MonilBhavsar @abzokhattab you have been assigned to this deploy blocker because you reviewed the offending PR".

    The approvals are on the record:

    He then approved the fix PR on 2026-09-04. That work is cleanup of a fault his own approval let through, so it is inside the original job price and earns nothing here.

    Melvin applied the wrong rule. The Contributor is a Backend Contributor, so Melvin correctly zeroed ishpaul777 and then paid the reviewer in full. That is the right answer on an ordinary issue. It is the wrong answer on a regression issue, because the reviewer is on the offending PR.

    The precedent, which is nearly identical

    #98833. PR #97671 by truph01 caused a deploy blocker. daledah and mollfpr approved it. Melvin proposed $250 each to truph01 and daledah.

    Matt answered: "I'm assuming payment isn't due cuz this regression came from the PR you two worked on."

    truph01 agreed: "This issue doesn't need payment, since it is a follow-up issue."

    Two more cases run the same way, #91136 and #98923. All three paid 0%.

    The counterargument, if `abzokhattab` appeals

    He can argue he could not have caught this. His first approval says he could only test on web, because the three backend PRs had not shipped and pageCount did not exist yet. The bug needs a multi-page distance receipt, which needs that backend.

    The record answers it. He approved a second time on 2026-09-01, after the backend merged, and said he updated the screenshots. So he did retest with the feature live.

    The C+ doc also lets the assigned internal engineer waive the reviewer penalty for a large PR that introduces new functionality. PR #97813 does introduce new functionality, but at 18 files and +130 lines it is not large. MonilBhavsar can still rule on it.

    Two things to handle outside this issue

    The twin issue pays nothing either. #100336 has the same offending PR, the same fix PR, the same assignees and the same payment date. Melvin will have proposed $250 there too. Paying both is $500.

    The penalty belongs on the original job. PR #97813 is titled "[Payment due @abzokhattab]" and closed Expensify/Expensify#667914. That is where abzokhattab gets paid for this work, and that is where the regression cut applies. #97813 caused two confirmed regressions, #100336 and this one, and the rule for two or more is 25% of the job price. Worth checking on 667914 before it is paid, if it has not been paid already.

    The Contributor+ checklist is still outstanding. It gates the regression test case, not the money, so it does not change anything above. The standing ask: plz complete the Contributor+ checklist and tag me in a post once you have. Thx

    On a live run this would tag abzokhattab and MonilBhavsar. It tags nobody here, because the comment carries a test marker.


    Claude posting on behalf of Matt. PAYRUBRICTEST v2

  14. mallenexpensify commented on Sep 16, 2026

    @mallenexpensify
    Contributor

    Going to close as not due payment, will leave open for a pass in case anyone wants to comment

  15. abzokhattab commented on Sep 23, 2026

    @abzokhattab
    Contributor

    Can be closed as its handled in #100336

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.DailyKSv2EngineeringReviewingHas a PR in review

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions