Skip to content

fix(rich-text-versioning): bump @contentful/app-sdk to 4.61.0 for cross-space resource dialogs [ES-199] - #11311

Open
Mitch Goudy (mgoudy91) wants to merge 1 commit into
masterfrom
mgoudy/ES-199-rtv-app-sdk-cross-space
Open

Mitch Goudy (mgoudy91) wants to merge 1 commit into
masterfrom
mgoudy/ES-199-rtv-app-sdk-cross-space

Conversation

@mgoudy91

@mgoudy91 Mitch Goudy (mgoudy91) commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is a re-attempt and demonstration of #11038. That pull request added cross-space resource dialog support to the Rich Text Versioning app. It was reverted after INC-1377. This pull request is a draft. It exists to test the isolation argument below before anyone treats it as ready to ship.

  • Bumps @contentful/app-sdk from ^4.42.0 to 4.61.0. This is an exact pin. It matches the version verified in the original fix(rich-text-versioning): bump @contentful/app-sdk to 4.61.0 [] #11038.
  • Adds selectSingleResourceEntity, selectMultipleResourceEntities, and recommendations support on entry selector dialogs. These were added in contentful/ui-extensions-sdk#2611.
  • Fixes ES-199. The embedded @contentful/field-editor-rich-text@6.3.9 calls sdk.dialogs.selectSingleResourceEntity(...) to insert a cross-space resource hyperlink or embed. That method did not exist on the old App SDK contract. The call threw TypeError: u.selectSingleResourceEntity is not a function.

Why this should not cause the same rollback as last time

Responders reverted #11038 after INC-1377, an incident where the RTV body field rendered blank. The RCA document does not name app-sdk as a cause. Here is the actual chain of events.

  1. On Jun 14, a separate pull request, fix(rich-text-versioning): bump field-editor-rich-text to 6.3.9 [ES-262] [ES-319] #11026, bumped @contentful/field-editor-rich-text to 6.3.9. That package depends on @contentful/field-editor-shared, which depends on react-query v5.
  2. The RTV app did not declare its own react-query version. npm and Vite hoisted the newest resolved version into the bundle. That version was v5.
  3. One component, FetchingWrappedInlineEntryCard, tests for the string status === 'loading'. That string is a v4-only status name. Under v5, the same state uses the string 'pending' instead. The loading guard never matched. The component rendered before its data arrived and crashed reading entry.sys on undefined.
  4. INC-1377 fired on Jun 30. Responders reverted fix(rich-text-versioning): bump @contentful/app-sdk to 4.61.0 [] #11038, the app-sdk bump. It was the most recent RTV change at that point. No one had verified it as the cause yet. The same pattern happened in the earlier INC-1278, where the newest merge was rolled back first, on suspicion alone. The RCA, written a few days later, traces the crash to the Jun 14 field-editor-rich-text bump and the react-query hoisting. It does not mention app-sdk.

@contentful/app-sdk has no react-query dependency at any version. I verified this directly with npm view @contentful/app-sdk dependencies, on both 4.61.0 and the current latest release, 4.70.0. Its only dependency is contentful-management. This bump sits in a separate branch of the dependency graph from the code that broke.

The actual fix, #11048, pinned @tanstack/react-query@4.44.0 as a direct dependency of the RTV app. That pin forces the whole bundle onto v4 status names, regardless of what other packages hoist. The pin is still present on master today. This pull request does not touch it. The lockfile diff proves this:

$ git diff master -- apps/rich-text-versioning/package-lock.json | grep -i react-query
(no output)

This reasoning rests on the dependency graph and the written RCA. It is not a live production test. The RTV app has broken on almost every version bump this year, for different reasons each time. A sound dependency argument is not the same as a verified result in staging. That is why the list below still has open items. A staging smoke test and soak period must happen before this pull request can be called ready for review.

Diff shape

The diff matches the shape of #11038: a version-only bump to package.json and package-lock.json, with no other code changes.

-    "@contentful/app-sdk": "^4.42.0",
+    "@contentful/app-sdk": "4.61.0",

Test plan

Context

Generated with Claude Code

@michaelphamcf Michael Pham (michaelphamcf) changed the title [TESTING] fix(rich-text-versioning): bump @contentful/app-sdk to 4.61.0 for cross-space resource dialogs [ES-199] fix(rich-text-versioning): bump @contentful/app-sdk to 4.61.0 for cross-space resource dialogs [ES-199] Sep 22, 2026
@michaelphamcf
Michael Pham (michaelphamcf) marked this pull request as ready for review September 22, 2026 15:47
…ss-space resource dialogs [ES-199]

Picks up selectSingleResourceEntity / selectMultipleResourceEntities and
recommendations support (shipped in contentful/ui-extensions-sdk#2611) so the
embedded @contentful/field-editor-rich-text@6.3.9 can open the cross-space
reference picker instead of throwing
`selectSingleResourceEntity is not a function`.

This is a re-attempt of #11038, which was reverted after INC-1377. Per the
RCA (docs.google.com/document/d/1Byt-fFwS_Z3), INC-1377 was caused by
@tanstack/react-query v5 getting hoisted through
@contentful/field-editor-shared, unrelated to the app-sdk bump. That was
fixed independently in #11048 by pinning react-query@4.44.0 as a direct
dependency, which this app still has. @contentful/app-sdk has no react-query
dependency, so this bump cannot reintroduce that failure mode.

npm run build and npm run test:ci (32 tests) pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@michaelphamcf
Michael Pham (michaelphamcf) force-pushed the mgoudy/ES-199-rtv-app-sdk-cross-space branch from 36f13e7 to 4dd9c11 Compare September 22, 2026 15:50
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.

2 participants