Skip to content

fix: green CI (typecheck + test) and re-land logout cache clear#11

Merged
ralyodio merged 2 commits into
masterfrom
fix/ci-green
Jun 12, 2026
Merged

fix: green CI (typecheck + test) and re-land logout cache clear#11
ralyodio merged 2 commits into
masterfrom
fix/ci-green

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

The sh1pt CI workflows (#6/#7, pnpm fix #10) run pnpm typecheck + pnpm test
on the whole monorepo and were failing on pre-existing issues. This makes both
green (typecheck 64/64, test 64/64).

Fixes

  • web signup: data.user possibly-null after the already-registered guard →
    explicit null check (a real type hole vitest missed).
  • core stripLiveSourceState: strip prices (fat live data); the stale test
    now expects tradeState KEPT (intentional — closedTrades history survives a
    cache miss).
  • cli statusFreshness: tests hardcoded the old 10s stale threshold; derive
    from TRADE_STALE_AFTER_MS (now 30s).
  • dealdash decide.test: find predicates weren't type guards → cancel/book
    helpers returned the full Decision union; narrowed with Extract<…>.

Also (re-landed)

  • SignOutForm: clears b1dz:* localStorage on sign-out (the earlier commit got
    orphaned during branch shuffling). Defense-in-depth on the per-user cache key.

🤖 Generated with Claude Code

ralyodio and others added 2 commits June 12, 2026 09:36
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>
@ralyodio ralyodio merged commit 238d6fc into master Jun 12, 2026
6 checks passed
@ralyodio ralyodio deleted the fix/ci-green branch June 12, 2026 09:49
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant