Skip to content

[Due for payment 2026-07-23] [Perf] Add selectors and dedupe Onyx subscriptions in the MoneyRequestReportPreview subtree #95706

Closed

Description

@cristipaval

Problem

An audit of the MoneyRequestReportPreview subtree found leftover Onyx
subscriptions that re-render the previews on frequent, unrelated events
(opening a report, card changes). Most of them are multiplied by the number
of transaction cards in the carousel, so the cost adds up.

The send-message path itself is clean. These are the remaining subscriptions:

  • MoneyRequestReportPreviewProvider subscribes to the chat report's
    REPORT_METADATA and RAM_ONLY_REPORT_LOADING_STATE without selectors,
    but only reads one field from each (isOptimisticReport and
    hasOnceLoadedReportActions). Any other change to those objects re-renders
    the whole provider tree.
  • Each TransactionPreview card holds a raw REPORT subscription with no
    selector.
  • TransactionPreviewContent subscribes to the entire CARD_LIST just to
    look up one card, and it duplicates a POLICY subscription that its parent
    (TransactionPreview) already has.

Goal

Add selectors and remove the duplicate subscription so each component
re-renders only when the data it actually reads changes:

  • MoneyRequestReportPreviewProvider — add a selector to
    REPORT_METADATA (read only isOptimisticReport) and to
    RAM_ONLY_REPORT_LOADING_STATE (read only hasOnceLoadedReportActions).
  • TransactionPreview — apply getStableReportSelector to the REPORT
    subscription.
  • TransactionPreviewContent — replace the full CARD_LIST subscription
    with a selector that returns only the one card it looks up.
  • TransactionPreviewContent — stop re-subscribing to POLICY; pass the
    policy down from TransactionPreview instead.

This is a perf cleanup only. Behavior should stay exactly the same.

Note: TransactionPreview is a shared component used outside the carousel
too, so the last three items need regression testing in the other places it
renders (transaction threads, Search, etc.).

Related

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. added
    Reviewing
    Weekly
    and removed
    Weekly
    on Jul 10, 2026
  2. OlimpiaZurek commented on Jul 10, 2026

    @OlimpiaZurek
    Contributor

    PR is ready for review: #95807

  3. OlimpiaZurek commented on Jul 13, 2026

    @OlimpiaZurek
    Contributor

    PR is in review: #95807. Fixed the conflicts and addressed one minor comment.

  4. added
    Daily
    and removed
    Reviewing
    Weekly
    on Jul 16, 2026
  5. changed the title [-][Perf] Add selectors and dedupe Onyx subscriptions in the MoneyRequestReportPreview subtree[/-] [+][Due for payment 2026-07-23] [Perf] Add selectors and dedupe Onyx subscriptions in the MoneyRequestReportPreview subtree[/+] on Jul 16, 2026
  6. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  7. melvin-bot commented on Jul 16, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.35-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2026-07-23. 🎊

    For reference, here are some details about the assignees on this issue:

  8. melvin-bot commented on Jul 20, 2026

    @melvin-bot

    @mkhutornyi Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  9. added
    Awaiting Payment
    on Jul 22, 2026
  10. melvin-bot commented on Jul 22, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  11. melvin-bot commented on Jul 22, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    BugZero Checklist (@mallenexpensify)

    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  12. mallenexpensify commented on Jul 24, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @mkhutornyi due $250 via NewDot

  13. trjExpensify commented on Aug 3, 2026

    @trjExpensify
    Contributor

    approved $250 for @mkhutornyi

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

Metadata

Metadata

Labels

Awaiting PaymentDaily

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions