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(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS · Issue #3991 · developing-today/code

id(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS #3991

New issue
Copy link
New issue
Copy link
Closed
#4510
Closed
id(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS#3991
#4510
Copy link
Assignees
dezren39
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/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Summary

pkgs/id chat presence bounds a heartbeat's channels list but not its typing list: typing is documented as a subset of channels ("The channels the node is currently typing in. A subset of channels", chat_presence.rs:107-109), yet neither the constructor, the table's receive path, nor the codec deduplicates or caps it. A heartbeat can carry an unbounded number of duplicate typing entries, so one signed heartbeat produces an arbitrarily large gossip frame and an arbitrarily large stored table entry — defeating MAX_HEARTBEAT_CHANNELS, whose stated purpose is to "bound the frame size and the work a single received heartbeat can make the table do" (chat_presence.rs:76-78).

Evidence (verified this run, main 70a595a)

  • PresenceHeartbeat::new (chat_presence.rs:138-161) deduplicates channels and truncates it to MAX_HEARTBEAT_CHANNELS (64), but for typing it only filters to entries present in channels — duplicates survive and there is no length cap.
  • PresenceTable::update_at (chat_presence.rs:296-301), the receive path, applies the same filter-only treatment to a decoded heartbeat's typing; heartbeats decoded from the wire never pass through new, so the constructor's invariants would not save this path anyway.
  • The production receiver in serve (commands/serve.rs:1575-1591) verifies the signature and then calls recv_presence.update(heartbeat). Signature verification does not help here: the sender signs its own bloated heartbeat with its own key, so verify() passes.
  • Laptop probe ~/git/fleet/probe-2026-11-01-laneA-presencetyping/ (verbatim chat_presence.rs, md5 68590664a175bd4a17937c28a2f0fb6b, matching sandbox main 70a595a; minimal stubs for groups::GroupView / waiting::AuthorKey):
    • PresenceHeartbeat::new(node, vec![chan], vec![chan; 100_000], ts) → channels.len() = 1, typing.len() = 100_000, encode_frame(...).len() = 3_300_087 bytes (~3.3 MB frame naming one channel).
    • Control: new with 500 distinct channels → channels.len() = 64 (the cap works for channels).
    • A wire-shaped heartbeat with typing = vec![chan; 50_000] round-trips through encode_frame/decode_frame at full length and is accepted by update_at.

Why it matters

Presence is an unauthenticated-reach, always-on gossip surface: any peer on the topic can get its own heartbeats accepted. The one size bound the protocol declares (64 channels) can be bypassed by three orders of magnitude through the sibling field, inflating every receiver's stored entry (retained until the TTL prune) and every re-gossiped frame. It is also a shape bug independent of size: duplicate typing entries mean the stored heartbeat's typing is not the set the docs promise, so any future consumer that iterates or counts it inherits the duplicates.

Acceptance criteria

  • PresenceHeartbeat::new deduplicates typing (after filtering to channels), so typing.len() <= channels.len() for every constructed heartbeat.
  • PresenceTable::update_at applies the same dedup/bound to decoded heartbeats, so a wire heartbeat with duplicate or excess typing entries is stored in bounded form (or refused), regardless of the constructor.
  • Regression tests: a heartbeat built or decoded with duplicate typing entries (e.g. 100_000 copies of one channel) is stored/encoded with at most one entry per channel; existing chat_presence tests keep passing.
  • The bound is stated next to MAX_HEARTBEAT_CHANNELS so the frame-size guarantee covers the whole heartbeat, not just channels.

Distinct from: #2809 (the presence protocol itself, closed — this is a residual bound gap in its merged implementation), #3927 (abuse evaluator oversize, different module), #3950 (chat v1 core remainder — membership/store/rate, not presence frame bounds).

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/lowNice to have; do when convenient
    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 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-a
    • Session / ID: new-issue-creator-code-a cron run 2026-11-01 15:05 CST
    • Found via: filed this run — read of the freshly merged chat presence module (pkgs/id/src/chat_presence.rs, id(chat): presence heartbeat protocol over gossip (ephemeral, TTL-based) #2809 / PR feat(id): chat presence heartbeat protocol over gossip (#2809) #3956) against current main 70a595a, verified with a laptop probe using the verbatim file.
    • Task: Filed this issue: a presence heartbeat's typing list is never deduplicated or bounded in PresenceHeartbeat::new (chat_presence.rs:138-161) or in the receive path PresenceTable::update_at (:296-301), so one channel yields a 3.3 MB signed gossip frame and an unbounded stored entry, defeating MAX_HEARTBEAT_CHANNELS (64). Probe: ~/git/fleet/probe-2026-11-01-laneA-presencetyping/ on the laptop (file md5 68590664a175bd4a17937c28a2f0fb6b) — new() with 100,000 duplicate typing entries keeps all 100,000 (frame 3,300,087 bytes); wire-decoded 50,000 duplicates accepted by update_at; control: 500 channels cap to 64.
    • Expectation: effort s; done when typing is deduplicated/bounded to the channel set in both the constructor and update_at, with regression tests per the issue's acceptance criteria.
    • Links: id(chat): presence heartbeat protocol over gossip (ephemeral, TTL-based) #2809 id(chat): presence heartbeat protocol over gossip (ephemeral, TTL-based) #2809 · id(chat): chat v1 core remainder — membership/history enforcement, store integration, rate admission (follow-on of #3799) #3950 id(chat): chat v1 core remainder — membership/history enforcement, store integration, rate admission (follow-on of #3799) #3950
  3. github-actions
    assigned
    dezren39
    on Nov 1, 2026
  4. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 2, 2026
  5. 40 remaining items

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

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    agent-note:v1 — state=parked; holder: repo-worker-code (OpenChamber scheduled lane); task_id: 6277; lane: aea12c82-c5af-4e5a-9b66-f8e360f87177; at: 2026-11-02T20:45:25Z. Parked for 20 minutes and ending this launch because CI remains pending on PR #4510. The PR is Drew-authored; do not touch or merge it. Preserve the existing PR/worktree. Resume after owner handoff or resolution, then re-read the checks fresh; merge only if green and all criteria are met.

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

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane code-b
    • Session / ID: task 6277
    • Found via: queue claim
    • Task: Resuming task 6277 at verified stage: PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510 implements the typing dedupe/bound fix for issue id(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS #3991. Re-verified fresh this shift: issue id(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS #3991 OPEN with no hard-stop labels, PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510 OPEN, single-file diff in pkgs/id/src/chat_presence.rs matches the acceptance criteria, no Codex review findings on PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510, and its checks now pass (basic guard pass, CodeRabbit skipping) — the earlier CI-pending park condition has cleared.
    • Expectation: effort s; done = PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510 merged under the standing criteria and task 6277 completed.
    • Links: PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510; branch queue/6277-3991-typing-dedupe
  10. dezren39
    added a commit that references this issue on Nov 2, 2026

    fix(id): deduplicate and bound typing claims in presence heartbeats (#…

    73c0ec7
  11. dezren39
    closed this as completedin #4510on Nov 2, 2026
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  13. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane code-b
    • Session / ID: task 6277
    • Found via: queue claim
    • Task: PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510 merged (squash, merge commit 73c0ec7) after fresh verification: checks pass, single-file diff matches issue id(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS #3991 acceptance criteria, no Codex findings, prior targeted tests passed 13/13. Issue id(chat-presence): heartbeat typing list is never deduplicated or bounded — one channel yields a 3.3 MB signed frame, defeating MAX_HEARTBEAT_CHANNELS #3991 closed by the merge.
    • Expectation: done.
    • Links: PR fix(id): deduplicate and bound typing claims in presence heartbeats #4510 fix(id): deduplicate and bound typing claims in presence heartbeats #4510
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

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/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/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

    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.