Skip to content

fix: reset StartupLogger on JS reload so runJsBundleStart marker is recorded#56616

Open
mohanrajvenkatesan2304-hash wants to merge 1 commit intofacebook:mainfrom
mohanrajvenkatesan2304-hash:fix/issue-56339-runjsbundlestart-marker-reset
Open

fix: reset StartupLogger on JS reload so runJsBundleStart marker is recorded#56616
mohanrajvenkatesan2304-hash wants to merge 1 commit intofacebook:mainfrom
mohanrajvenkatesan2304-hash:fix/issue-56339-runjsbundlestart-marker-reset

Conversation

@mohanrajvenkatesan2304-hash
Copy link
Copy Markdown

Summary:

This is a regression in 0.83 from PR #54255, which made StartupLogger reset itself when APP_STARTUP_START fires. On JS reload, RUN_JS_BUNDLE_START and INIT_REACT_RUNTIME_START arrive first and are rejected as duplicates by the still-populated logger; only afterward does APP_STARTUP_START fire and clear the state. The result is NaN start times paired with valid end times, so performance.measure('runJsBundle', 'runJsBundleStart', 'runJsBundleEnd') throws The mark 'runJsBundleStart' does not exist. on every reload after the first load.

The fix is to pre-emptively call StartupLogger::reset() at the top of ReactInstance::loadScript so every load (including reloads) starts with a clean logger and the startup markers are recorded correctly each time.

Fixes #56339.

Changelog:

[GENERAL] [FIXED] - Reset StartupLogger on JS reload so runJsBundleStart performance marker is recorded after the first load

Test Plan:

…ecorded (facebook#56339)

PR facebook#54255 (which made StartupLogger reset on APP_STARTUP_START) introduced a regression in 0.83 where the `runJsBundleStart` performance marker is dropped on JS reload. On reload, RUN_JS_BUNDLE_START and INIT_REACT_RUNTIME_START fire and are rejected by the still-populated StartupLogger as duplicates; only afterward does APP_STARTUP_START fire and reset the logger, leaving NaN start times paired with valid end times. As a result `performance.measure('runJsBundle', 'runJsBundleStart', 'runJsBundleEnd')` throws "The mark 'runJsBundleStart' does not exist." after the first load.

Pre-emptively call StartupLogger::reset() at the top of ReactInstance::loadScript so every load (including reloads) starts with a clean logger and the startup markers are recorded correctly each time.
@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 27, 2026

Hi @mohanrajvenkatesan2304-hash!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 27, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@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 Apr 27, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Apr 27, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Apr 27, 2026

@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D102561906.

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runJsBundleStart performance marker dropped on JS reload due to APP_STARTUP_START reset cascade in ReactInstance::loadScript (regression in 0.83)

1 participant