Skip to content

[Due for payment 2026-03-19] Optimize ManualOpenCreateExpense with policy selector and reduced subscriptions #84789

Closed

Description

@marcaaron

Problem

The Create Expense flow (ManualOpenCreateExpense span) has unnecessary Onyx re-renders from heavy subscriptions. The full policy collection, unneeded NVP fields, and redundant state syncing cause extra render cycles on mount and tab switches, adding ~20ms of overhead.

Solution

Reduce re-renders by trimming subscriptions, implemented in #84286:

  • Add a policy collection selector (iouRequestPolicyCollectionSelector) that filters to only the ~15 fields needed by IOURequestStartPage consumers
  • Derive selectedTab directly instead of using useState + syncing useEffect
  • Add an NVP selector for SCAN_TEST_TOOLTIP instead of subscribing to the full NVP_DISMISSED_PRODUCT_TRAINING
  • Remove duplicate Tab.setSelectedTab call (already handled by OnyxTabNavigator)

Note: The PR also removed the reportDrafts collection subscription from IOURequestStepConfirmation, relying on the module-level allReportsDraft variable instead. This needs to be reverted since it relies on an impure function pattern we're actively removing.

Issue OwnerCurrent Issue Owner: @BartekObudzinski

Activity

  1. marcaaron commented on Mar 10, 2026

    @marcaaron
    ContributorAuthor

    @BartekObudzinski Can you please address @mountiny's comment here? Thanks!!

  2. melvin-bot commented on Mar 11, 2026

    @melvin-bot

    ⚠️ Looks like this issue was linked to a Deploy Blocker here

    If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.

    If a regression has occurred and you are the assigned CM follow the instructions here.

    If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.

  3. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Mar 12, 2026
  4. changed the title [-]Optimize ManualOpenCreateExpense with policy selector and reduced subscriptions[/-] [+][Due for payment 2026-03-19] Optimize ManualOpenCreateExpense with policy selector and reduced subscriptions[/+] on Mar 12, 2026
  5. melvin-bot commented on Mar 12, 2026

    @melvin-bot

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

  6. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.3.36-10 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-03-19. 🎊

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

  7. melvin-bot commented on Mar 12, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  8. melvin-bot commented on Mar 19, 2026

    @melvin-bot

    Skipping the payment summary for this issue since all the assignees are employees or vendors. If this is incorrect, please manually add the payment summary SO.

  9. melvin-bot commented on Mar 24, 2026

    @melvin-bot

    @BartekObudzinski Eep! 4 days overdue now. Issues have feelings too...

  10. marcaaron commented on Mar 25, 2026

    @marcaaron
    ContributorAuthor

    Not sure anything needs to be done here going to close.

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions