RelationshipTable: join table with an async server Cell blanks the whole admin when cacheComponents is enabled
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- nextjs, react, typescript
Research direction
The async state updates after getTableState resolves in packages/ui/src/elements/RelationshipTable/index.tsx, around lines 157 and 172-175. Read how the table and column state are set there, then reproduce with the linked repro under cacheComponents enabled, checking that the admin no longer goes blank while the table streams. Done means "Loading…" stays visible until the table arrives, with the same behaviour when cacheComponents is off.
Written by the indexing model from the issue text.
Description
Describe the Bug
With cacheComponents: true, opening a document whose join field shows a column with an async server Cell hides the entire admin, not just the table, until every cell has loaded.
RelationshipTable awaits getTableState and applies the result with plain state setters, outside a transition (index.tsx#L157, #L172-L175). getTableState resolves while the returned Table is still streaming, so rendering it suspends. With cacheComponents on, withPayload sets PAYLOAD_CACHE_COMPONENTS_ENABLED (withPayload.js#L40) and the root layout wraps the admin in <Suspense fallback={null}> (Root/index.tsx#L52-L53), so the suspension reaches that boundary and the page goes blank.
Expected: "Loading…" stays until the table has arrived, as it does with cacheComponents: false.
Applying the result in a transition fixes it (verified on the reproduction: "Loading…" stays until the whole table is in, and the page never blanks):
-import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react'
+import React, { Fragment, startTransition, useCallback, useEffect, useRef, useState } from 'react'
@@
- setData(newData)
- setTable(NewTable)
- setColumnState(newColumnState)
- setIsLoadingTable(false)
+ startTransition(() => {
+ setData(newData)
+ setTable(NewTable)
+ setColumnState(newColumnState)
+ setIsLoadingTable(false)
+ })
The same code is unchanged on 3.x and main. 4.0.0-beta.6 doesn't show the symptom because its root layout no longer wraps the admin in Suspense, but the cause in RelationshipTable remains.
Link to the code that reproduces this issue
https://github.com/isaac-openmic/upstream-repros/tree/main/payload-19268
Reproduction Steps
npm install && npm run build && npm start- Log in at http://localhost:3000/admin as
[email protected]/test(seeded on first start). - Open Teams → Team. The Members table shows "Loading…", then the whole admin goes blank for ~1.5 s (the
Cell's timer), then the full table appears.
Which area(s) are affected?
area: ui
Environment Info
payload: 3.92.1
@payloadcms/next, @payloadcms/ui, @payloadcms/db-sqlite: 3.92.1
next: 16.3.3 (production build, cacheComponents: true)
react / react-dom: 19.2.6
node: 24.22.2
- Dominant language
- TypeScript
- Stars
- 45.6k
- Forks
- 4.4k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 288
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from payloadcms/payload
-
richtext-lexical: the editor upload card shows the cropped `thumbnail` size instead of the imageOpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
payloadcms/payload#19318 · 1 comment ·
Maintainers usually reply within 1 day
-
richtext-lexical: `slashMenu.dynamicGroups` are dropped (self-concatenation in the merge, and not offered on a bare "/")Possibly taken @muhammad-wasif-code claimed this 1 day ago. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
payloadcms/payload#19317 · 1 comment ·
Maintainers usually reply within 1 day
-
ui field: admin.components.Cell is rendered in the edit view's form state and throws (`key in` on an array in renderField)Possibly taken A pull request linked to this issue is open or already merged. Openarea: ui Bug status: needs-triage v3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
payloadcms/payload#19314 ·
Maintainers usually reply within 1 day
-
Declared video mimetype not corrected to detected type (isProcessableImage only covers images)Possibly taken @Emreceyhnn claimed this 1 day ago. OpenBug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
payloadcms/payload#19294 · 1 comment ·
Maintainers usually reply within 1 day
-
File URLs get a trailing slash when Next.js trailingSlash is enabled (404 on every upload)Possibly taken A pull request linked to this issue is open or already merged. Openarea: core area: uploads Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19292 ·
Maintainers usually reply within 1 day
All issues in payloadcms/payload
Similar issues
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timingOpene2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
devswha/herdr-web-ui#2884 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
b:minor bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-mansion/argent#1771 ·
Maintainers usually reply within 1 day
-
Resources: New palettes of XiamenPossibly taken @rmt-svc claimed this today. Openresources
Difficulty 1/5 1-3 hours Newbie friendliness 74/100
railmapgen/rmg-palette#2491 ·
Maintainers usually reply within 4 days