You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dash: archive, eviction and janitor delete by session id only, so one tenant's rows can be removed with another's #1069
Archiving, eviction and the janitor remove rows by session_id alone. On the hosted path the stored id is tenant:base (session.Scoped), so two tenants cannot normally share one; rows written another way (tests, direct inserts, an import) can. Archiving or evicting that id for one tenant can then delete the other tenant's rows. This is data loss, not a wrong figure.
Found in the review of #1064 (the fix for #501). Not reproduced: this comes from reading the code. A reproduction test should come first.
Where
On main:
dash/archive.go around line 297: DELETE FROM request_content WHERE request_id IN (SELECT id FROM requests WHERE session_id = ?).
dash/archive.go around line 345: DELETE FROM requests WHERE session_id = ?.
dash/janitor.go around line 382: DELETE FROM requests WHERE session_id = ?.
dash/store.go around line 1032: DELETE FROM requests WHERE session_id IN (...).
archived_sessions.session_id: dash/schema.go (comment near line 617) and dash/toolinventory_test.go (near line 660) call this a known defect, in the same shape as the tool inventory key that was already fixed by putting tenant_id first.
Proposal
Add tenant_id to every one of these WHERE clauses. The candidate lists (c.SessionID, victims) need to carry the tenant too.
Make tenant_id lead the key of archived_sessions, as tool_declarations already does.
Test: two tenants on one session id. Archive or evict one tenant. The other tenant's rows must stay.
Fixed in #1064 (merged 2026-11-11): the archive, janitor and eviction deletes now filter on (tenant_id, session_id), and archived_sessions is keyed PRIMARY KEY (tenant_id, session_id), with a migration for existing databases.
Activity
fix(dash): scope archive, eviction, all-tenant session views and seed…
fix(dash): keep one tenant's rows out of another's per-session figures (
boazdavid commentedon Nov 16, 2026
Fixed in #1064 (merged 2026-11-11): the archive, janitor and eviction deletes now filter on
(tenant_id, session_id), andarchived_sessionsis keyedPRIMARY KEY (tenant_id, session_id), with a migration for existing databases.