Skip to content

Commit be51268

Browse files
fix(tables): flush unowned layout when the views fetch fails
The resolve effect is the only caller of resolvePendingLayout and gated on isSuccess, which never becomes true on a query error — so layout touched during the load window was never persisted on the error path, even though the table had already settled to All and later writes worked. The error branch now flushes to shared metadata, matching the rest of the error path's fall-back-to-All behavior.
1 parent d4a1bc2 commit be51268

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]

apps/sim/app/workspace/[workspaceId]/tables/[tableId]/table.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,16 @@ export function Table({
492492
* view even after someone changes which view is default.
493493
*/
494494
useEffect(() => {
495-
if (!viewsEnabled || !viewsLoaded) return
495+
if (!viewsEnabled) return
496+
// A failed fetch settles to All (`viewOwnerUnknown` cleared, sink unbound),
497+
// so layout touched during the load must flush here — no other branch of
498+
// this effect ever runs on the error path, and skipping it would silently
499+
// drop the resize on refresh.
500+
if (viewsFailed) {
501+
resolvePendingLayout(false)
502+
return
503+
}
504+
if (!viewsLoaded) return
496505

497506
if (seededViewIdRef.current === undefined) {
498507
// Embedded tables bind these parsers to the HOST page's URL, which the
@@ -574,6 +583,7 @@ export function Table({
574583
}, [
575584
viewsEnabled,
576585
viewsLoaded,
586+
viewsFailed,
577587
views,
578588
activeView,
579589
activeViewId,

0 commit comments

Comments
 (0)