Skip to content

[Due for payment 2026-05-15] [$250] Add guard in OnyxUtils to skip subscriptions for invalid keys #74470

@mountiny

Description

@mountiny

Background

Some code paths attempt to subscribe to collection members whose IDs are invalid (e.g., report_undefined, ..._null, ..._NaN).
Even with skippableCollectionMemberIDs configured, these invalid keys still create a subscription and emit an initial callback, adding overhead and noise.

Problem

Subscriptions are created for invalid keys like report_undefined, which still emit an initial callback and add overhead.

Solution

Add a guard in OnyxUtils.subscribeToKey that checks skippableCollectionMemberIDs and, if the collection member ID is skippable (e.g., 'undefined', 'null', 'NaN'), do not connect the subscription or emit the initial value, but return a subscriptionID so disconnect() is safe.

Results

Reduces fireCallbacks invocations by ~12% skipping all the invalid collection IDs

Next steps

Do testing and comparison of the effect of this change in real account

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021986409233270874405
  • Upwork Job ID: 1986409233270874405
  • Last Price Increase: 2025-11-06
Issue OwnerCurrent Issue Owner: @hoangzinh
Issue OwnerCurrent Issue Owner: @waterim

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions