GeezerVison is showing github.com — aggregator(views): ViewsStore load accepts duplicate ids, duplicate names and multiple defaults — one remove(id) then silently deletes two distinct views · Issue #4301 · developing-today/code
aggregator(views): ViewsStore load accepts duplicate ids, duplicate names and multiple defaults — one remove(id) then silently deletes two distinct views #4301DescriptionProblem
ViewsStore enforces its cross-row invariants only in the mutating methods, never at load:
save() (pm-stack/aggregator/src/views.ts:276-280) and rename() (:296-302) refuse a second view with the same name (case-insensitive) for one owner.
setDefault() (:322-337) maintains at most one default per owner.
- View ids are treated as identity everywhere:
get() (:268) finds by id, actions address one view by id.
But doLoad() (:205-225) validates rows only per-row via isSavedView (:88-104) — the #4150 hardening checks each row's shape and quarantines the file if a row is malformed. It performs no cross-row check: duplicate ids, duplicate per-owner names, and multiple per-owner defaults all load verbatim (this.views = rows.filter(isSavedView)).
Verified this run
Laptop probe ~/git/fleet/probe-2026-11-02-laneB-viewsload/probe.ts against the real views.ts @ 23c2c514 (md5 c682e11f5536262812db98431838d6b2, matched on sandbox and laptop). A store file holding 5 shape-valid rows for one owner — ids vw-a (name Alpha, default), vw-b (name Beta, default), vw-dup (name Gamma), vw-dup (name Delta), vw-e (name alpha) — loaded with:
loaded_count 5 — no quarantine, no complaint;
- two defaults for the owner;
defaultFor silently returns vw-a (first after the createdAt sort — the two rows even share a timestamp);
get("vw-dup") returns only Gamma;
remove("vw-dup", owner) returned true and deleted BOTH Gamma and Delta (count 5 → 3), because remove() (:309-316) filters by id — and the deletion was persisted (a reloaded store also shows 3 rows).
So one delete-view action addressed to a single view can silently delete a second, distinct saved view, permanently, the moment a store file ever contains a duplicated id (hand edit, file merge, an older/buggier writer, a restored backup). The duplicate-name pair likewise breaks the invariant save() promises later callers, and duplicate defaults make the landing-page default an accident of row order.
Why it matters
Saved views are per-person dashboard state reached through the audited action path; the store's own discipline elsewhere is fail-loud (quarantine, never silently overwrite — module header, views.ts:10-14). Silently accepting cross-row duplicates converts a data anomaly into silent data loss on the next routine delete, instead of a loud quarantine at load when the file can still be preserved.
Acceptance criteria
Dedup / related
Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item effort/sSmall: expected under 2 hours of work on Nov 2, 2026dezren39 commented on Nov 2, 2026 🤖 Agent note · filed
- Agent: new-issue-creator-code-b (new-issue-creator job, Lane B)
- Session / ID: new-issue-creator-code-b run 2026-11-02 03:20 CST
- Found via: filed this run
- Task: Filed after verifying on the laptop that ViewsStore.doLoad performs no cross-row invariant check: a shape-valid store file with a duplicated view id loads verbatim, and remove(id) then deletes two distinct views and persists the loss.
- Expectation: effort/s — triage confirms the load-time policy (quarantine vs logged repair), then the fix rejects or repairs duplicate ids / duplicate per-owner names / multiple per-owner defaults at load with regression tests in views.test.ts.
- Links: laptop probe ~/git/fleet/probe-2026-11-02-laneB-viewsload/ (real views.ts @23c2c514, md5 c682e11f5536262812db98431838d6b2)
dezren39 commented on Nov 5, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 5, 2026 🤖 Agent note · blocked
- Agent: queue worker (repo-worker-code), lane code-z
- Session / ID: task 6175
- Found via: queue claim (attempts 16/24)
- Task: Task 6175 (fix for issue aggregator(views): ViewsStore load accepts duplicate ids, duplicate names and multiple defaults — one remove(id) then silently deletes two distinct views #4301) is blocked on ownership, re-verified fresh this shift: PR fix(aggregator): reject duplicate saved views on load #4536 — the canonical implementation on branch
queue/6175-4301-viewsstore-invariants — is still OPEN, non-draft, and Drew-authored (dezren39), and issue aggregator(views): ViewsStore load accepts duplicate ids, duplicate names and multiple defaults — one remove(id) then silently deletes two distinct views #4301 is OPEN and assigned to dezren39. Standing verdict from the task 6175 checkpoints, which this shift re-confirms: do not touch or merge the Drew-owned canonical PR, and do not create competing work. Codex review on PR fix(aggregator): reject duplicate saved views on load #4536 completed at d801134 with no findings (per checkpoint record).
- Expectation: blocked until Drew either merges/closes PR fix(aggregator): reject duplicate saved views on load #4536 or explicitly hands off ownership of the PR/issue; then revalidate fresh and resume task 6175 from the existing branch/worktree (~/git/fleet/6175). Blocking (rather than another 1200s park) stops the claim cycle that has consumed 16 of 24 attempts without any state change.
- Links: PR fix(aggregator): reject duplicate saved views on load #4536; issue aggregator(views): ViewsStore load accepts duplicate ids, duplicate names and multiple defaults — one remove(id) then silently deletes two distinct views #4301; task 6175
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|