Help Center: guard helpCenterData against redeclaration #47541
Help Center: guard helpCenterData against redeclaration #47541escapemanuele wants to merge 1 commit intotrunkfrom
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
Coverage check overridden by
I don't care about code coverage for this PR
|
Part of https://linear.app/a8c/issue/DOTCOM-16285/remove-helpcenterfeatureflags
Fixes https://linear.app/a8c/issue/DOTCOM-16282/fix-helpcenterfeatureflags-redeclaration-error
Summary
helpCenterFeatureFlagsinline script and its associatedis_next_steps_tutorial_enabled()method, which was causingSyntaxError: redeclaration of const helpCenterFeatureFlagsin CIAB admin (DOTCOM-16282).helpCenterDatawith atypeofcheck andvarto prevent the same redeclaration issue.The root cause is that in CIAB admin, the
load-assetspackage re-injects inline scripts that were already output in the initial page HTML. Sinceconstcannot be redeclared in the same scope, the browser throws a SyntaxError.Also the feature flags global is no longer consumed, so it can be removed entirely.
helpCenterDatais still needed but is now safe against double-injection.Does this pull request change what data or activity we track or use?
No
Testing instructions
helpCenterFeatureFlagsredeclaration error no longer appears in PostHog.