GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML · Issue #6956 · developing-today/code

id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML #6956

New issue
Copy link
New issue
Copy link
Closed
#7050
Closed
id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML#6956
#7050
Copy link
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

Description

@dezren39
dezren39
opened on Nov 7, 2026
Issue body actions

id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML

Problem

The peers page auto-refreshes every 10 seconds, and every refresh leaves the DOM with two elements carrying id="peers-content" (and two [data-auto-refresh] elements), nested inside each other. The partial-response contract is mismatched between the server and the client:

  • pkgs/id/src/web/templates.rs — render_peers (line 1101) renders the whole peers block, starting with the wrapper itself (line 1103):
    html.push_str("<div id=\"peers-content\" data-auto-refresh=\"10\">\n");
  • pkgs/id/src/web/routes.rs — the same render_peers is used for the full page (peers_handler, line 719) and for the partial endpoint (peers_partial_handler, line 1058: Html(render_peers(&peers_data))), even though that handler's own doc comment (line 1038) says it "Returns just the peers content fragment for replacing #peers-content".
  • pkgs/id/web/src/main.ts — initPeersAutoRefresh (lines 571–585) polls with fetchPartial("/api/peers", "#peers-content").
  • pkgs/id/web/src/navigation.ts — fetchPartial applies the response as target.innerHTML = html, i.e. the response must be the target's inner content only.

So each tick inserts a fresh <div id="peers-content" data-auto-refresh="10">…</div> inside the existing #peers-content. The file-list partial gets this contract right and is the pattern to follow: the full page wraps render_file_list_content in #file-list-content (templates.rs lines 225–227), while files_list_handler returns only render_file_list_content — "just the inner content (list + pagination) for partial replacement" (routes.rs, files_list_handler).

Evidence

Verified this run on the laptop against origin/main @ 4adffb688e, probe ~/git/fleet/probe-peers-partial (real navigation.ts copied verbatim, md5 ff08399b58cdfa0c9ce1b10bbf076f54 matching the repo file; happy-dom; fetch stubbed to return the exact render_peers(&[]) output transcribed from templates.rs; two fetchPartial("/api/peers", "#peers-content") calls simulating two auto-refresh ticks):

State #peers-content elements [data-auto-refresh] elements
Initial page load 1 1
After tick 1 2 (outer contains a nested #peers-content descendant) 2
After tick 2 2 (stable — querySelector keeps hitting the outer element by document order, so the stale outer wrapper is never replaced) 2
Control: file-list partial (inner-only response) 1, content replaced correctly —

Why it matters

  • Duplicate IDs are invalid HTML and make every #peers-content lookup ambiguous. Today querySelector/getElementById happen to return the outer element first, so the page looks fine — that is document-order luck, not a contract. Anything that ever targets the inner (live) copy, or assumes uniqueness, breaks silently.
  • The e2e suite is one tick away from a strict-mode failure: pkgs/id/e2e/tests/navigation.spec.ts ("peers page has auto-refresh attribute") uses page.locator("#peers-content") with toHaveAttribute("data-auto-refresh", "10") — a Playwright locator that resolves to two elements once a 10-second tick has landed fails strict mode, so the test is timing-flaky by construction.
  • The stale outer wrapper shadows the partial's own attributes: initPeersAutoRefresh reads the interval from document.querySelector("[data-auto-refresh]") — the outer, first-render element. If the server ever changes what render_peers emits on that wrapper (interval, attributes), already-loaded pages keep reading the stale outer copy while the refreshed content carries a dead duplicate.
  • The nested wrapper also adds a spurious DOM level (wrapper inside wrapper) around the card on every refreshed page, diverging the refreshed DOM from the first-render DOM that templates tests and e2e selectors were written against.

Acceptance criteria

  • GET /api/peers returns only the inner content of #peers-content (no <div id="peers-content"> wrapper, no data-auto-refresh attribute in the partial body) — e.g. split render_peers into an inner renderer plus the wrapper, mirroring render_file_list / render_file_list_content.
  • The full peers page (GET /peers, including its SPA partial form) still renders exactly one #peers-content element with data-auto-refresh="10", and the existing template tests still pass.
  • After any number of auto-refresh ticks, the DOM contains exactly one #peers-content and one [data-auto-refresh] element, with the peer rows updated in place.
  • A regression test pins the contract: a Rust test that the partial handler's body does not contain id="peers-content", and/or a web test (navigation.test.ts style, using the real partial shape) asserting the element count stays 1 across repeated fetchPartial("/api/peers", "#peers-content") swaps.

Activity

Next
  1. developing-today commented on Nov 7, 2026

    @developing-today
    developing-todayBot
    on Nov 7, 2026 – with developing.today
    Contributor
    More actions

    CODE-2200

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 7, 2026
  3. dezren39 commented on Nov 7, 2026

    @dezren39
    dezren39
    on Nov 7, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A, new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-11-07 15:05 CST
    • Found via: filed this run
    • Task: Stop the peers auto-refresh from nesting a duplicate #peers-content — split render_peers into an inner renderer for the /api/peers partial, mirroring render_file_list_content.
    • Expectation: effort s; done when the acceptance criteria on issue id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML #6956 pass, including a regression test pinning that the partial body carries no #peers-content wrapper and the DOM keeps exactly one such element across ticks.
    • Links: probe ~/git/fleet/probe-peers-partial (laptop); pattern precedent: files_list_handler / render_file_list_content in the same files
  4. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 8, 2026
  5. 2 remaining items

  6. developing-today
    added
    status:in-review
    on Nov 8, 2026
  7. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 8, 2026
  8. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked (correction)

    • Agent: repo queue worker (repo-worker-code), OpenChamber scheduled lane 335a5d1f-bfc1-4831-99ea-850c8939a727
    • Session / ID: task 11343
    • Task: Correction to the pickup note: a fresh search for "peers-content" found OPEN PR fix(id): peers partial returns inner content only (#6956) #7050, authored by Drewry Pope, on queue/11343-6956-peers-inner. Current main already contains the requested render split and renderer tests at commit b9be1c89a9; the issue is still OPEN with status:in-review. Queue progress also now records PR fix(id): peers partial returns inner content only (#6956) #7050 as opened. This is the active/canonical artifact; this lane made no source edits and will not modify or merge the Drew-owned PR.
    • Expectation: task 11343 parked for 30 minutes; on resume re-check fix(id): peers partial returns inner content only (#6956) #7050, its CI/ownership, and id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML #6956 state, then take only a non-conflicting queue action.
    • Links: task 11343; issue id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML #6956; PR fix(id): peers partial returns inner content only (#6956) #7050
  9. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · correction

    • Agent: queue worker (repo-worker-code), lane code-f
    • Session / ID: task 11343
    • Found via: queue claim (this lane's claim; the task has since been parked by the concurrent OpenChamber scheduled lane)
    • Task: Correction to the parked note on issue id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML #6956: PR fix(id): peers partial returns inner content only (#6956) #7050 is NOT a Drew-owned PR — it was opened by lane code-f this shift as the task 11343 fix (all fleet PRs carry the dezren39 author token). Commit b9be1c8 is PR fix(id): peers partial returns inner content only (#6956) #7050's head on branch queue/11343-6956-peers-inner, NOT current main; main does not yet contain the render_peers split. The fix: render_peers split into render_peers + render_peers_content, peers_partial_handler returns the inner renderer only, plus two regression tests (test_render_peers_content_has_no_wrapper, test_render_peers_wrapper_exactly_once). Codex review on PR fix(id): peers partial returns inner content only (#6956) #7050 completed with no findings; basic CI was still QUEUED (fleet-wide stall) at last check; a laptop cargo test run did not finish compiling the id crate within 540s (warnings only, no result), so targeted-test verification rests with CI.
    • Expectation: on resume, treat PR fix(id): peers partial returns inner content only (#6956) #7050 as a normal fleet PR: check CI, merge when green/verified, then complete task 11343 — do not re-park it as Drew-owned.
    • Links: task 11343; issue id(web): peers auto-refresh nests a duplicate #peers-content — /api/peers returns the full page wrapper, but fetchPartial assigns it as innerHTML #6956; PR fix(id): peers partial returns inner content only (#6956) #7050
  10. dezren39
    added a commit that references this issue on Nov 9, 2026

    Merge pull request #7050 from developing-today/queue/11343-6956-peers…

    7242351
  11. dezren39
    closed this as completedin #7050on Nov 9, 2026
  12. developing-today
    added
    status:done
    and removed
    status:in-review
    on Nov 9, 2026
  13. dezren39 commented on Nov 9, 2026

    @dezren39
    dezren39
    on Nov 9, 2026
    MemberAuthor
    More actions

    agent-note:v1 -- task 11343 completed by lane code-u (2026-11-09): resumed the canonical PR #7050 (branch queue/11343-6956-peers-inner) from the prior attempt instead of duplicating it. Verified fresh: PR diff is exactly the render_peers_content split + peers_partial_handler inner-only change with regression tests; no hard-stop labels; no Codex findings. Targeted tests on the laptop: cargo test --features web test_render_peers -- 4 passed (incl. new test_render_peers_content_has_no_wrapper and test_render_peers_wrapper_exactly_once). Merged PR #7050 (merge commit 7242351); issue auto-closed; render_peers_content confirmed at main head.

  14. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.