6ceec5e161
The shared-wallet stopgap keeps ONE React tree across a faux-logout + re-login under a different identifier (AccountContext.login only rewrites a localStorage id; AuthGate never remounts, no page reload). FestipodDataContext's by-need read set accumulates the current identity's scope docs and was never reset on identity change, so the PREVIOUS identity's PROTECTED docs (its participations) survived in the new identity's read set and leaked through the union read — the in-memory cap gate can't filter a doc it doesn't govern this session. Symptom: user B saw A's participation, and A's event surfaced on B's home (home = getUserEvents(currentUserId)). Treat every identifier change as a fresh session: a ref-guarded useEffect([username]) clears publicDocs/protectedDocs, resetCaps(), resetRegistryCache(), then bumps the read tick so the listing effect rebuilds the set bounded to the new identity. Isolation stays per-document/emulated; the reset only drops cross-identity carryover. Documented in knowledge_context-internals. Validated (@data, real broker): after an A→B switch, B does not participate and does not read A's participation; protected-isolation/read-filter/auth scenarios pass. tsc + build green; lib untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>