fix: green CI (typecheck + test) and re-land logout cache clear#11
Merged
Conversation
Logout is a server form POST (clears the session cookie) and can't touch localStorage, so cached client state (b1dz:source-state:*) lingered for the next account on a shared browser. New SignOutForm client component wipes all `b1dz:*` localStorage keys on submit, then performs the normal server logout. Applied to all sign-out buttons (home, dashboard, projections, console, store, settings). Defense-in-depth on top of per-user cache keying. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The new sh1pt CI workflows run `pnpm typecheck` + `pnpm test` on the whole monorepo, which surfaced pre-existing failures (and one I'd just introduced): - web signup route: `data.user` possibly null after the obfuscation guard — add an explicit null check (was a real type hole vitest didn't catch). - core stripLiveSourceState: strip `prices` (fat live data); update the stale test to expect `tradeState` KEPT (intentional — closedTrades history). - cli statusFreshness: tests hardcoded the old 10s stale threshold; make them derive from TRADE_STALE_AFTER_MS (now 30s) so they're robust. - dealdash decide.test: `find` predicates weren't type guards, so cancel/book helpers returned the full Decision union (alert variant lacks `reason`) — narrow them with `d is Extract<Decision, …>`. typecheck 64/64, test 64/64. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The sh1pt CI workflows (#6/#7, pnpm fix #10) run
pnpm typecheck+pnpm teston the whole monorepo and were failing on pre-existing issues. This makes both
green (typecheck 64/64, test 64/64).
Fixes
data.userpossibly-null after the already-registered guard →explicit null check (a real type hole vitest missed).
prices(fat live data); the stale testnow expects
tradeStateKEPT (intentional — closedTrades history survives acache miss).
from
TRADE_STALE_AFTER_MS(now 30s).findpredicates weren't type guards → cancel/bookhelpers returned the full
Decisionunion; narrowed withExtract<…>.Also (re-landed)
SignOutForm: clearsb1dz:*localStorage on sign-out (the earlier commit gotorphaned during branch shuffling). Defense-in-depth on the per-user cache key.
🤖 Generated with Claude Code