Skip to content

[Due for payment 2026-02-16] [Onyx Audit] Remove Outdated Batching Mechanism from Onyx #79338

Closed

Description

@mountiny

Coming from this proposal

Background

A lot of time ago the withOnyx HOC was the primary subscription mechanism in the Onyx.
To optimize performance, a custom batching system that uses unstable_batchedUpdates from React was implemented.
This batching logic collects multiple state updates to group subscriber notifications into a single React render cycle.

Over time, several things have happened:

  • The useOnyx hook, which is now the recommended pattern, was implemented. But custom batching logic wasn't adjusted to support the hook subscribers. It continued to work only for the withOnyx subscribers (more details here: [Onyx Audit] Batching mechanism feels overcomplicated Expensify/App#71207 (comment))
  • The withOnyx HOC has been deprecated in favor of the useOnyx hook.
  • React 18 introduced automatic batching for all updates (including those in promises, setTimeout, and native event handlers), which changes how state updates are batched in modern React applications.

Problem

When Onyx processes state updates in a codebase that no longer uses withOnyx, if legacy batching logic is still applied, then state update behaviour becomes harder to understand and maintain without providing clear benefits.

Solution

Remove the entire custom batching mechanism from Onyx and rely on React's native automatic batching capabilities.
Draft PR: Expensify/react-native-onyx#689

Issue OwnerCurrent Issue Owner: @bfitzexpensify

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 12, 2026
  2. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Triggered auto assignment to @bfitzexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. melvin-bot commented on Jan 12, 2026

    @melvin-bot

    Current assignee @mountiny is eligible for the AutoAssignerNewDotQuality assigner, not assigning anyone new.

  4. VickyStash commented on Jan 12, 2026

    @VickyStash
    Contributor

    The PR has been opened for review!

  5. melvin-bot commented on Jan 20, 2026

    @melvin-bot

    @VickyStash Still overdue 6 days?! Let's take care of this!

  6. 9 remaining items

  7. VickyStash commented on Jan 23, 2026

    @VickyStash
    Contributor

    Bump PR was merged!
    🤞 for it to hit the prod!

  8. mountiny commented on Jan 24, 2026

    @mountiny
    ContributorAuthor

    Nice job!

  9. melvin-bot commented on Feb 16, 2026

    @melvin-bot

    This issue has not been updated in over 15 days. @VickyStash, @mountiny, @bfitzexpensify, @stitesExpensify, @mkhutornyi eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  10. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Feb 16, 2026
  11. changed the title [-][Onyx Audit] Remove Outdated Batching Mechanism from Onyx[/-] [+][Due for payment 2026-02-16] [Onyx Audit] Remove Outdated Batching Mechanism from Onyx[/+] on Feb 16, 2026
  12. mountiny commented on Feb 16, 2026

    @mountiny
    ContributorAuthor

    $250 to @mkhutornyi

  13. mountiny commented on Feb 16, 2026

    @mountiny
    ContributorAuthor

    @VickyStash This can be closed after the payment, right?

  14. VickyStash commented on Feb 16, 2026

    @VickyStash
    Contributor

    @mountiny Yeah, i think so

  15. bfitzexpensify commented on Feb 20, 2026

    @bfitzexpensify
    Contributor

    Payment summary:

    @mkhutornyi due $250 via NewDot manual request

  16. quinthar commented on Mar 28, 2026

    @quinthar
    Contributor

    Approved $250 to @mkhutornyi

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

Metadata

Metadata

Labels

AutoAssignerNewDotQualityUsed to assign quality issues to engineersAwaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.MonthlyKSv2

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions