[bug][page-templates] lookup context can strand an id in-flight on a partial server response #35

Closed
opened 2026-06-20 20:36:07 +03:00 by Ghost · 0 comments

From review of #17 (merged to develop).

apps/client/src/features/editor/components/page-embed/page-embed-lookup-context.tsx flush() clears inFlightRef / resolves pendingRef only for ids present in the response items. If the server ever returns fewer items than requested, the missing id stays in inFlightRef forever (never re-fetched because of the else if (!inFlightRef...has) guard; its refresh() promise never resolves).

The current server contract (lookupTemplate maps exactly over sourcePageIds) guarantees one item per requested id, so it cannot trigger today — but harden by iterating the original ids in the success branch and clearing/resolving any still-in-flight id (as the catch branch already does).

Severity: low.

From review of #17 (merged to develop). `apps/client/src/features/editor/components/page-embed/page-embed-lookup-context.tsx` `flush()` clears `inFlightRef` / resolves `pendingRef` only for ids present in the response `items`. If the server ever returns fewer items than requested, the missing id stays in `inFlightRef` forever (never re-fetched because of the `else if (!inFlightRef...has)` guard; its `refresh()` promise never resolves). The current server contract (`lookupTemplate` maps exactly over `sourcePageIds`) guarantees one item per requested id, so it cannot trigger today — but harden by iterating the original `ids` in the success branch and clearing/resolving any still-in-flight id (as the `catch` branch already does). Severity: low.
Ghost closed this issue 2026-06-21 02:05:32 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vvzvlad/gitmost#35