Skip to content

Skip observer notifications during performance tracing#55777

Open
emily8rown wants to merge 1 commit intofacebook:mainfrom
emily8rown:export-D94075642
Open

Skip observer notifications during performance tracing#55777
emily8rown wants to merge 1 commit intofacebook:mainfrom
emily8rown:export-D94075642

Conversation

@emily8rown
Copy link
Contributor

Summary:
During performance tracing, LogBoxStateSubscription was causing an unnecessary re-render even though LogBox messages are already dropped. This happened because async work (e.g. symbolication completing) could trigger handleUpdate() during a trace, notifying observers and causing LogBoxStateSubscription to setState and re-render.

The fix adds an isTracing() guard inside handleUpdate()'s setImmediate callback so observer notifications are skipped for the entire duration of a trace. When tracing ends, a new handleUpdate() call syncs observers with the current (cleared) state.

This eliminates a spurious update visible in Marketplace sell items page performance traces.

Differential Revision: D94075642

Summary:
During performance tracing, LogBoxStateSubscription was causing an unnecessary re-render even though LogBox messages are already dropped. This happened because async work (e.g. symbolication completing) could trigger `handleUpdate()` during a trace, notifying observers and causing `LogBoxStateSubscription` to `setState` and re-render.

The fix adds an `isTracing()` guard inside `handleUpdate()`'s `setImmediate` callback so observer notifications are skipped for the entire duration of a trace. When tracing ends, a new `handleUpdate()` call syncs observers with the current (cleared) state.

This eliminates a spurious update visible in Marketplace sell items page performance traces.

Differential Revision: D94075642
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 26, 2026
@meta-codesync
Copy link

meta-codesync bot commented Feb 26, 2026

@emily8rown has exported this pull request. If you are a Meta employee, you can view the originating Diff in D94075642.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants