Skip to content

[Performance] Remove app-wide policy categories and tags subscriptions #100808

Closed

Description

@cristipaval

What performance issue do we need to solve?

OnyxListItemProvider stays mounted for the whole app session. It currently subscribes to the full POLICY_CATEGORIES and POLICY_TAGS collections.

These subscriptions run a multiGet for every collection member when they start. They also rebuild the full collection object when any member changes.

Only three places use this data, and each place needs the categories or tags for one policy only.

What is the impact of this on end-users?

These subscriptions add unnecessary Onyx work for every app session. The impact can be larger for high-traffic accounts with many policies, categories, or tags.

There is no expected UI behavior change from removing them.

List any benchmarks that show the severity of the issue

Profiling showed two collection-wide subscriptions that stay active for the whole app session.

More context and a profiling screenshot are available in this comment.

Proposed solution

Subscribe directly to the required policy key in each consumer:

  • Read POLICY_CATEGORIES${policyID} in MoneyRequestView.
  • Read POLICY_TAGS${targetPolicyID} in MoneyRequestView.
  • Read POLICY_CATEGORIES${policyID} in IOURequestStepConfirmation.
  • Remove PolicyCategoriesProvider and PolicyTagsProvider from OnyxListItemProvider.
  • Remove their exported hooks.
  • Add tests to confirm categories and tags still come from the correct workspace.

A draft implementation is available in Remove PolicyCategoriesProvider and PolicyTagsProvider.

List any benchmarks after implementing the changes to show impacts of the proposed solution

The two collection-wide subscriptions are removed. Each consumer subscribes only to the policy data it needs.

No timing benchmark was collected because this is a cleanup of unnecessary subscriptions and should not change app behavior.

Platforms

This affects shared app code and applies to all platforms:

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

Version Number: Latest main
Reproducible in staging?: Yes
Reproducible in production?: Yes
Notes/Photos/Videos: Profiling screenshot and investigation context
Issue reported by: @LukasMod

Issue OwnerCurrent Issue Owner: @LukasMod

Activity

  1. self-assigned this
    on Sep 10, 2026
  2. melvin-bot commented on Sep 15, 2026

    @melvin-bot

    @Julesssss / @cristipaval @LukasMod

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

  3. cristipaval commented on Sep 15, 2026

    @cristipaval
    ContributorAuthor

    the PR for this one went into prod. No payment is due here

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

Metadata

Metadata

Labels

Daily

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions