Skip to content

SITES-49454: [Extensibility] Host issues affects RTE loading on CFE - #153

Merged
kokoc merged 2 commits into
mainfrom
SITES-49454-host-empty-extensions
Sep 21, 2026
Merged

kokoc merged 2 commits into
mainfrom
SITES-49454-host-empty-extensions

Conversation

@fe-lix-

@fe-lix- fe-lix- commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Description

Supersedes #152 with the same fix, plus an added regression test.

When the CF Editor's extension point resolves to zero extensions, Extensible.tsx used to skip creating the Host object entirely, so host stayed undefined forever and any consumer gated on host readiness (CFE's TipTap RTE via useRTEBeforeLoad) hung on its loading skeleton indefinitely. Root cause: PR #94 moved new Host()/setHost() inside the guard that used to gate only .load().

This carries over #152's fix unchanged (cherry-picked, same author/commit): gate host creation on extensionListFetched instead of on extensions being non-empty, and only skip .load() — not host creation — when there's nothing to load.

What's added on top of #152

#152 didn't cover the specific new behavior this fix enables: a host created early with zero extensions must be reused (not torn down and recreated) once extensions actually arrive. That path was untested — I verified by hand that it works correctly, then added a test for it so a future refactor can't silently regress it again the way #94 did.

Related Issue

SITES-49454

How Has This Been Tested?

Open follow-up (not blocking, flagged for awareness)

Per the Jira root-cause comment, CFE readiness is described as depending on host.loading / the loadallguests event. This fix's loadExtensions() deliberately never calls .load() when there are zero extensions, so loadallguests never fires for that path (though host.loading is false by default, so anything reading that field directly is fine). Worth confirming with whoever owns useRTEBeforeLoad in aem-headless-ui-commons that readiness doesn't hard-require the loadallguests event specifically.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.

🤖 Generated with Claude Code

Volodymyr Zaiets and others added 2 commits September 21, 2026 14:58
…ition

The fix in the previous commit lets Extensible create a Host as soon as
the extensions list settles, even when it resolves empty — but nothing
covered the resulting new-behavior path: extensions arriving *after*
that empty resolve. Add a test asserting the existing host is reused
(not torn down/recreated) and that load() fires once the real
extension list shows up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@fe-lix-
fe-lix- force-pushed the SITES-49454-host-empty-extensions branch from d90756c to 4f16d13 Compare September 21, 2026 12:58
@kokoc
kokoc merged commit 9fc584e into main Sep 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants