Skip to content

[Due for payment 2026-09-25] Optimize hasEnabledTags used by MoneyRequestView #101863

Closed

Description

@mountiny

Problem

Opening a report could spend around 100ms just to answer whether a policy has any enabled tags. hasEnabledTags allocated three throwaway arrays of every tag in the policy (filter, then map(Object.values), then flat), plus another array inside hasEnabledOptions, before returning a boolean. MoneyRequestView then ran that same check twice per render: once to decide whether to show the tag row, and once for the "tags disabled" alert.

Solution

hasEnabledTags now walks the tag lists with plain loops and returns as soon as it finds the first enabled, non-deleted tag, so it allocates nothing and the result is unchanged. MoneyRequestView computes the value once per render and reuses it for both the tag row and the alert.

PR

#101862

Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. melvin-bot commented on Sep 24, 2026

    @melvin-bot

    @mountiny @TMisiukiewicz

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

  2. changed the title [-]Optimize hasEnabledTags used by MoneyRequestView[/-] [+][Due for payment 2026-09-25] Optimize hasEnabledTags used by MoneyRequestView[/+] on Sep 25, 2026
  3. melvin-bot commented on Sep 25, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  4. melvin-bot commented on Sep 25, 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
  5. mallenexpensify commented on Sep 26, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @aimane-chnaif due $250 via NewDot

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 productionDailyKSv2Task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions