Skip to content

fix(aggregator): shell pages — a stalled/failed fragment must surface, not spin (board/today/attention) #1503

Closed

Description

@dezren39

Problem (observed in source + live sizes, 2026-10-27)

The three highest-traffic pages — / (board), /today, /attention — are shells (#1444): the server returns nav + a skeleton ("Loading the board…", "Loading today…") and the real content streams in as a Datastar fragment (data-on-load="@get('/frag/…')"). The only fallback in the shell markup is a <noscript> meta-refresh to ?full=1.

There is no error or timeout path: src/render.ts / src/server.ts contain no fragment error handling at all (verified by grep — no data-on-error, no watchdog). If the fragment request fails or stalls — tailnet hiccup, server busy (full renders measured today at 2.36 MB for the board and 3.53 MB for attention), a wedged source — the page sits on its skeleton indefinitely: no message, no retry affordance, no link through to the full render. To the reader that is indistinguishable from "the dashboard doesn't load", and it is a plausible contributor to exactly that report that is not a data problem.

Design

A shell-side watchdog, no protocol change: if the fragment has not replaced the skeleton within ~10 s, the skeleton is swapped for an inline notice — the live view didn't arrive — <a href="?full=1">load the full page</a> — implemented in the shell's own inline script / Datastar error hooks. The ?full=1 server render already exists and is the no-JS path; this just gives the JS path a way to reach it when the fragment dies.

Acceptance

  • With /frag/* requests blocked, each of /, /today, /attention shows the notice with a working full-page link within the time bound.
  • Normal path unchanged: when the fragment lands, no notice ever appears.
  • ?full=1 renders are untouched.

Related: #1444 (introduced the shells), #1179 (fragment weight — the stall risk grows with it).

Activity

  1. added
    priority/normalOrdinary priority (the default)
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Oct 27, 2026
  2. developing-today commented on Oct 27, 2026

    @developing-today
    Contributor
  3. added
    effort/sSmall: expected under 2 hours of work
    source/humanFiled directly by a human
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Intake review

    Related: #1444 (shells), #1179 (fragment weight). Liveness: no merged PR adds fragment error handling — checked merged aggregator PRs through 2026-10-27 (#1434, #1330 latest); issue is live. Its ## Acceptance section is a full criteria set in substance, so no duplicate section was appended.

    Notes / risks / suggested approach: Risk: watchdog must never fire on the normal path (slow-but-live fragments on a busy server) — the time bound and the fragment-replaced check are the delicate parts. Suggested approach: shell inline script / Datastar error hooks only, no protocol change, exactly as designed; test with /frag/* blocked per page.

    🤖 Agent note · filed

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: repo-fleet-monitor run 2026-10-27 14:19 CDT — intake enrichment (protocol §5)
    • Found via: monitor reconciliation
    • Task: Shell pages (/, /today, /attention) spin forever when the Datastar fragment stalls/fails; add a ~10s shell-side watchdog swapping the skeleton for a notice linking ?full=1.
    • Expectation: intake only this run — labels normalized, liveness checked, acceptance criteria in place; the fix itself routes through the normal queue/sweep path
    • Links: n/a
  5. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  6. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane C
    • Session / ID: queue task 2603 (triage; repo-queue-worker-shift-c, 2026-11-01T04:47Z)
    • Found via: queue claim
    • Task: Triage fix(aggregator): shell pages — a stalled/failed fragment must surface, not spin (board/today/attention) #1503 against current main: verify the aggregator shell pages still have no fragment error/timeout path, then route as a scoped follow-up packet or close with evidence.
    • Expectation: effort s; done = agent-note triage verdict posted, follow-up packet enqueued if confirmed, labels synced.
    • Links: queue task 2603
  7. 23 remaining items

  8. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Released to the queue under Drew's 2026-11-13 unblock-all order (main chat, 23:53 CT). Task(s) 15168 moved from blocked/parked to queued in the fleet unblock-all pass (worker main-unblock-all-2026-11-13). Dependency gates still recorded on a task remain recorded — the dependency checker will re-block it if a gate is genuinely unmet.

  9. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 14, 2026
  10. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane any-d shift
    • Session / ID: queue task 15168 · repo-queue-worker-shift-any-d 2026-11-14 04:42 CST
    • Found via: queue claim (triage packet; fix in scope per packet acceptance, worked direct per §1b/§1c after five prior handoffs)
    • Task: Implement the shell fragment watchdog designed in this issue
    • Expectation: Done — merged; the watchdog ships on the next aggregator deploy

    Outcome

    PR #9934 merged (squash 79606607397e75d11066effebf0881b9c30c402a, 2026-11-14T11:28:18Z); this issue closed by the merge.

    • pm-stack/aggregator/src/render.ts: shared FRAG_WATCHDOG_SCRIPT (bound FRAG_WATCHDOG_MS = 10_000) wired into all five shell renderers — board, attention, today, queue, overview. Ten seconds after a shell renders, any [data-frag] container still holding its .skel skeleton gets it swapped for an inline notice ("the live view did not arrive — load the full page") linking that page's ?full=1 render. In-time fragments remove the skeleton themselves (watchdog no-ops); late fragments replace the notice. No protocol change; ?full=1 renders untouched — acceptance criteria met as designed.
    • pm-stack/aggregator/src/ui.css: .frag-failed styling in dark + both light-theme selector lists.
    • pm-stack/aggregator/test/frag-watchdog-1503.test.ts: 4 new tests (bound, all five shells, attention's three containers, today health-strip order).

    Verification

    • New tests 4/4 pass; test/render.test.ts 30/30 pass; affected-area files 177 named tests pass (only failures: unnamed server-boot hook timeouts, the same flake class present on unmodified main).
    • bunx tsc --noEmit: 22 errors — identical count to unmodified main, none in touched files.
    • Full suite: branch 2324 pass / 19 fail vs main 2327 / 16 across repeated runs (main itself varies 16–19; failures are browser/boot/live-source environment timeouts in both trees, none in render/shell tests).
    • Codex review on PR fix(aggregator): shell pages surface a stalled/failed fragment instead of spinning (#1503) #9934: the review run failed on Codex usage limits and posted no findings (zero inline review comments from any reviewer; CodeRabbit processed the 3 files with no actionable comments). Nothing undispositioned.

    Task 15168 completes as fixed_merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workepic/pm-stackReprioritization program epic (2026-11-12)kind/enhancementmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/humanFiled directly by a humanstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions