Skip to content

fix(j5): J5 Connect sign-in follow-ups - #1261

Merged
Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/j5-connect-signin-followups
Nov 27, 2026
Merged

Jacksondr5 merged 2 commits into
j5/mainfrom
j5code/j5-connect-signin-followups

Conversation

@Jacksondr5

Copy link
Copy Markdown
Owner

Problem

CodeRabbit's inline review of #1257, which arrived after that PR's re-check, found that a J5 Connect outage could still pass for an answer. These are the findings the Eng Lead accepted; the rest are answered on their threads.

What changed

  • Join's secret check (CodeRabbit thread 4723233799): only a 4xx invalid_grant or invalid_request for the made-up code counts as the secret accepted. Dex answers an outage with a 500 invalid_request, so a 5xx now fails the check.
  • What counts as an answer (4723233751): a pass counts as J5 Connect answering only when discovery answers and so does at least one refresh, where there are any. A refresh answers when it succeeds or is refused with a 4xx. Refreshes that all time out, or all meet a server error, count as no answer, so a laptop that wakes into a token-endpoint outage lapses no one. A server whose only account is disabled still lapses it after 24 passes, through the no-answer count. A 5xx from the key endpoint also counts as no answer.
  • Secret with config (4723233745, the snapshot part): a pass reads the J5 Connect and its client secret together at its start, so it never sends a newer J5 Connect's secret to the old one's endpoints.
  • Client id change (4723233755): rejoining with another client id forgets the accounts, as joining another issuer does. Bindings and refresh tokens survive a rejoin only when the issuer and the client id are both unchanged.
  • iat required (4723233784): an ID token must carry iat.
  • No raw provider text in errors (4723233791): OidcError.status holds only the HTTP status and an OAuth error code it recognizes. The raw answer goes in cause.
  • Tests and code style (4723233730, 4723233736, 4723233741):
    • the paired-session test asserts the exact account id;
    • the fake J5 Connect refuses a disabled account at sign-in, and the lapse test checks that before the account is reactivated;
    • Identity.ts imports ReadChanges as a namespace.

Tests

identity/Identity.test.ts now covers:

  • a refresh outage, with discovery up, after a 30-hour sleep: no one lapses;
  • the stalled-refresh case, which now needs one account whose refresh answers;
  • rejoining with the same client, which keeps the accounts, and with another client, which forgets them and signs their devices out;
  • sign-in refused while the account is disabled;
  • the exact account id on a paired session.

The no-ID-token case now lapses through the no-answer count. It lapses on pass 25, because the first refresh spends the token and later refreshes meet a refusal that looks like an outage.

Live testing

No live run: this is server logic covered by the in-process J5 Connect tests above. Nothing a person sees changed.

Upstream impact

None. J5-owned files only.

Checklist

  • One concern: the description has no "also"
  • Tests cover the changed behavior
  • UI changes: none
  • Live testing: the section above says why none
  • Upstream-owned files: none
  • Upstream product: no change
  • Surfaces: server only
  • Docs: no change needed; PR 4 carries the J5 Connect docs

Built by Claude Opus 5.5 in Claude Code (J5 Code).

🤖 Generated with Claude Code

From CodeRabbit's review of #1257:
- The join's secret check counts only a client error about the made-up
  code as the secret taken; a 5xx `invalid_request` (Dex's outage answer)
  fails it.
- A pass counts as answered only when discovery answers and so does at
  least one refresh, when there are any: refreshes that all time out or
  meet a server error are no answer, and the lapse waits on the count.
- A pass reads the J5 Connect and its secret together at its start.
- Rejoining with another client id forgets the accounts, as another
  issuer does.
- An ID token must carry `iat`.
- An error's status holds only the HTTP status and a recognized OAuth
  error code; the raw answer stays in its cause.
- Tests assert the exact account a session came from, and a disabled
  account cannot sign in until it is active again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 27, 2026 8:30pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between dc30306 and 632c05b.

Files selected for processing: 4

  • apps/server/src/j5/identity/Identity.test.ts
  • apps/server/src/j5/identity/Identity.ts
  • apps/server/src/j5/identity/Oidc.ts
  • apps/server/src/j5/identity/test-support/fakeConnect.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added size:M 30-99 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list. labels Nov 27, 2026
…answered

- A failed discovery or a missing client secret is never an answer.
- A refresh's failure is an answer only for a 2xx or a 4xx response;
  a redirect, a server error, a timeout or an unreadable answer is not.
- The join probe treats a token for the made-up code as a probe error.
- A token endpoint error keeps its raw response text as the cause.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added size:L 100-499 effective changed lines (test files excluded in mixed PRs). and removed size:M 30-99 effective changed lines (test files excluded in mixed PRs). labels Nov 27, 2026
@Jacksondr5
Jacksondr5 enabled auto-merge (squash) November 27, 2026 20:35
@Jacksondr5
Jacksondr5 merged commit 1ff3f1b into j5/main Nov 27, 2026
39 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/j5-connect-signin-followups branch November 27, 2026 20:48

This branch was successfully deployed

1 active deployment
Preview — 632c05b3 Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant