Skip to content

fix(console): preserve valid sessions across reloads - #303

Merged
mohanagy merged 2 commits into
developmentfrom
fix/300-console-session-recovery
Jul 29, 2026
Merged

fix(console): preserve valid sessions across reloads#303
mohanagy merged 2 commits into
developmentfrom
fix/300-console-session-recovery

Conversation

@mohanagy

Copy link
Copy Markdown
Owner

Closes #300

Summary

  • resume a still-valid Console session after reload or a second tab through a cookie-authenticated, no-store session endpoint
  • distinguish malformed, expired, reused, superseded, and wrong-process bootstrap codes without exposing credential material
  • show one contextual recovery action for missing, expired, invalidated, or unreachable Console sessions
  • document the 15-minute idle / one-hour absolute session model and exact miftah dashboard recovery command

Security properties preserved

  • bootstrap codes remain one-use, invocation-bound, and terminal-only
  • session cookies remain HttpOnly and SameSite=Strict
  • CSRF proofs are restored only to page memory and are never written to persistent browser storage, URLs, config, logs, or audit arguments
  • exact Host/Origin checks, loopback binding, request limits, credential rotation, and fail-closed session invalidation remain intact

TDD and validation

The focused contracts were added first and failed against the previous reload behavior. Final validation:

  • npx vitest run tests/console-server.test.ts tests/oauth-console-threat-model-docs-contract.test.ts
  • npm run test:oauth-console
  • npm test
  • npm run test:core
  • npm run test:coverage (Node 20.20.2, CI-aligned; 1,785 passed, 33 conditional/platform skips; 95.65% statements)
  • npm run lint
  • npm run typecheck
  • npm run build
  • npm run smoke:cli
  • npm run check:pack
  • npm run test:package

Coverage-specific lifecycle tests cover reload startup, multiple tabs, BFCache/back-forward navigation, expiry, code reuse, credential rotation/process replacement, hostile Origin rejection, and redacted recovery states.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d5aba393-d32b-49bd-ade2-6cf0428cd587

📥 Commits

Reviewing files that changed from the base of the PR and between d045980 and 80f7146.

📒 Files selected for processing (6)
  • docs/cli.md
  • docs/console-api.md
  • src/console/console-assets.ts
  • src/console/console-server.ts
  • tests/console-server.test.ts
  • tests/oauth-console-threat-model-docs-contract.test.ts

Comment @coderabbitai help to get the list of available commands.

@mohanagy

Copy link
Copy Markdown
Owner Author

CodeRabbit is rate-limited on this PR, so its status is not being treated as approval.

Independent review was completed at exact current head 80f7146071dac53599cbfc69e016acecd450cf78. The reviewer found one blocker in the first head: 429 rate_limit_exceeded could incorrectly tell the user to re-enter the code. That finding was fixed with a red-first browser contract in 80f7146. Re-review reports no remaining blockers and independently passed 39/39 focused tests plus git diff --check.

Current-head CI remains required before merge.

@mohanagy
mohanagy merged commit d98eb9a into development Jul 29, 2026
12 checks passed
@mohanagy
mohanagy deleted the fix/300-console-session-recovery branch July 29, 2026 19:05
mohanagy added a commit that referenced this pull request Jul 29, 2026
* fix(console): explain filtered configurations (#302)

Show aggregate discovered/ready/attention counts without exposing rejected paths, explain safe repair categories, and preserve trusted discovery containment. Includes regression contracts and all review fixes.

Closes #203.

* fix(console): preserve valid sessions across reloads (#303)

* fix(console): resume valid sessions after reload

* fix(console): explain unlock rate limiting

* fix(setup): explain environment secret readiness (#304)

* fix(setup): explain environment secret readiness

* fix: make secret readiness guidance truthful

* fix: keep readiness guidance visible

* fix: preserve environment readiness invariants

* fix: prevent stale readiness guidance

* release: prepare v0.5.2 (#306)

* release: prepare v0.5.2

* test: bind release notes to current patch

* test: scope release links to fixed section
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.

[Console] Make unlock expiry and refresh recovery explicit

1 participant