GeezerVison is showing github.com — aggregator(card-state): actions load filter never checks payload — a null/malformed payload crashes cardState on every render, a string answers fabricates a survey answer · Issue #2444 · developing-today/code
aggregator(card-state): actions load filter never checks payload — a null/malformed payload crashes cardState on every render, a string answers fabricates a survey answer #2444DescriptionSummary
The actions store's load filter checks only that a record has a string id — its payload is never shape-checked on load — and cardState() (the render-time derivation every dashboard card goes through) dereferences payload unguarded. One stored action record with a malformed payload crashes card rendering for every page that shows that object, and the store re-persists the record forever. The write path validates payloads thoroughly (validateActionInput, actions.ts:226-313), so this is reachable only through the store file itself: a hand edit, a partial/rolled-back write from an older build, or any future writer that skips the boundary validator — exactly the class of record the load filter exists to contain (cf. #2347, the same filter's createdAt hole).
Evidence (main 5a34fa7)
pm-stack/aggregator/src/actions.ts:438-443 — doLoad() keeps any record with a string id; payload (and everything else) passes through unchecked.
pm-stack/aggregator/src/card-state.ts:75 — snooze.payload.until: payload: null (or a missing payload on a snooze) throws TypeError: null is not an object.
pm-stack/aggregator/src/card-state.ts:89-90 — the answer merge does a.payload.answers ?? [] and iterates entries as entry.questionId / entry.value, plus a.payload.optionId:
answers: [null] throws (entry.questionId on null).
answers: {…} (non-array object) throws ({} is not iterable).
answers: "ab" (string) does not throw — it iterates characters and writes a fabricated answer keyed undefined, silently corrupting the card's survey state.
- Consumers:
cardState is called per card from render.ts:1984, :2035, :2265, :2329, fed by ActionsStore.byObject() (actions.ts:471) in the board/attention render contexts (server.ts:266, :285, :546, :557) — a throw propagates out of the page render. persist() (actions.ts:449+) re-writes the record on every store write, so the poisoned record never ages out.
Verified this run with a laptop Bun probe driving the real ActionsStore + cardState (files byte-identical to main, md5 card-state.ts 99991e54…, actions.ts 6a43e179…), one malformed record per store file, valid id/createdAt so the record loads and sorts cleanly:
control OK loaded 1 suppressed: "snoozed" answered: []
payload-null THREW: TypeError: null is not an object (evaluating 'snooze.payload.until')
answers-null-entry THREW: TypeError: null is not an object (evaluating 'entry.questionId')
answers-object THREW: TypeError: {} is not iterable
answers-string OK loaded 1 suppressed: null answered: [[null,null]] <- fabricated answer
Probe: ~/git/fleet/probe-2026-10-29-laneB-cardpayload/probe.ts (laptop).
Why it matters
The actions store is the dashboard's own write-ahead record of user intent (snoozes, dismissals, survey answers). A single malformed record — which the load path explicitly tolerates keeping — takes down every board/attention render that includes its object and keeps doing so across restarts, because the record is re-persisted verbatim. The string-answers shape is worse than a crash: it fabricates a survey answer that was never given.
Acceptance criteria
- A stored action whose
payload is null/missing/not an object, or whose payload.answers is not an array of {questionId, value} entries, cannot throw out of cardState() and cannot fabricate an answered entry.
- Regression tests at the layer triage pins (load filter rejecting/normalizing the record, and/or
cardState tolerating it): the four probe shapes above (null payload on a snooze; answers: [null]; answers as a plain object; answers as a string) each render a card without throwing and without a phantom answer.
- Well-formed records behave exactly as today (the probe's control case: snooze suppresses, answers merge latest-wins).
- Sibling of aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 (same load filter,
createdAt field): fixing both in the load filter is welcome, but this issue is complete on the payload shapes alone.
Dedup
gh searches (open + closed) for cardState, payload answers: #1474 (closed — rejected-restore semantics in card-state, different defect), #1451 (closed — the multi-question feature itself). #2347 (open) covers the same load filter's createdAt sort crash in all()/CommentsStore, not payload dereference in cardState. No open issue covers payload shape at load or in card-state.
Activitydeveloping-today commented on Oct 29, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item effort/xsTrivial: expected under 30 minutes of work on Oct 29, 2026dezren39 commented on Oct 29, 2026 🤖 Agent note · filed
- Agent: new-issue-creator-code-b
- Session / ID: new-issue-creator-code-b cron run 2026-10-29 16:50 CDT
- Found via: filed this run
- Task: Filed aggregator(card-state): actions load filter never checks payload — a null/malformed payload crashes cardState on every render, a string answers fabricates a survey answer #2444 — the actions store load filter (actions.ts:438-443) checks only a string
id, so a stored action with a null/malformed payload reaches cardState() (card-state.ts:75, :89-90), which dereferences it unguarded: null payload on a snooze, answers: [null], and answers as a plain object each throw out of every board/attention render for that object; answers as a string silently fabricates a survey answer. The record is re-persisted verbatim, so it never ages out. Verified with a laptop Bun probe driving the real ActionsStore + cardState (main 5a34fa7, files md5-matched to the laptop clone).
- Expectation: effort xs; done when the four probe shapes render without throwing and without a phantom answer, with regression tests at the layer triage pins, and well-formed records unchanged. Sibling of aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 (same filter, createdAt field).
- Links: aggregator(card-state): actions load filter never checks payload — a null/malformed payload crashes cardState on every render, a string answers fabricates a survey answer #2444 aggregator(card-state): actions load filter never checks payload — a null/malformed payload crashes cardState on every render, a string answers fabricates a survey answer #2444 · aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347
dezren39 commented on Nov 1, 2026 🤖 Agent note · picked up (resume of parked task)
dezren39 commented on Nov 1, 2026 dezren39 commented on Nov 1, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|