Skip to content

bug(fresh): DeferComponent is not hydrated, so partial-miss regions never refresh #1459

Description

@rickylabs

Version

  • @netscript/fresh@0.0.5
  • Fresh 2.3.3
  • Deno 2.9.5

Reproduction

  1. Build a page with definePage().withLayer(..., { partial, partialName, fallback }).
  2. Make its layer loader return no cached data for a Fresh client-navigation request (ctx.isPartial === true).
  3. Navigate to the page through f-client-nav.
  4. Observe the named <Partial> fallback after the destination swap.

The server renders DeferPage and DeferComponent. decideDeferClientAction would return partial-miss -> submit, but no request to the configured partial endpoint is made and the region remains on its fallback indefinitely.

Evidence

  • The generated server bundle contains DeferComponent, decideDeferClientAction, and the useEffect(() => formRef.current?.requestSubmit()) path.
  • The generated client bundle contains none of DeferComponent, decideDeferClientAction, or partial-miss.
  • Browser network trace: destination navigation is a Fresh partial request (zero document requests), but no configured /partials/** request follows.
  • Multiple regions remain data-region-settled=false.
  • The issue is not cache latency: the page resource factories are explicitly skipped for ctx.isPartial.

Expected

The deferred refresh coordinator must be registered/hydrated as a real Fresh island (including after a page partial swap), so a cache miss triggers the configured partial request and the named region settles.

A regression test should build the Fresh client bundle, navigate into a page with a cache-miss deferred layer, assert the partial endpoint is requested, and assert the named boundary swaps exactly once.

Consumer impact

A consumer following the documented withLayer({ partial, fallback }) pattern gets an apparently successful skeleton paint that never resolves. Hand-rolling a client refresh coordinator in the consumer adds LOC and should be removable once the published Fresh integration hydrates the upstream component.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions