Rewrite the JMAP client, the stores and the JMAP types #125

Merged
jcoffey-dev merged 1 commits from phase3/data into main 2026-10-19 02:10:51 +00:00
Owner

Phase 3 of the console rewrite, part 2. Stacked on #124, so merge that first.

Rewritten from what they do, with new tests written first:

  • the JMAP client: requests, the registry-write listener, batched gets and query paging
  • the auth, account, cache, schema and UI stores
  • the permissions hook, whose checks are now a plain function with tests
  • types/jmap.ts

The client and the stores had little or no test coverage before; the new client and store tests were also run against the old code and pass there too. Storage keys (inbuxa-auth, inbuxa-ui), exports and behavior are unchanged. Removed because nothing used them: jmapQuery, the cache's per-type invalidation, the permissions hook's edition checks, and two unused JMAP types. The suite goes from 701 to 724 tests.

Not upstream's Upstream lines left Dual headers
#124 79.7% 15,098 in 62 files 50
this PR 81.5% 13,775 in 51 files 39

That ends phase 3. The plan expected 81.4%.

Visual check: see #124. That check covered both phase 3 PRs and found no change in the UI.

Typecheck, lint, i18n:check, tests, build and notice check pass locally. No new strings.

Phase 3 of the console rewrite, part 2. Stacked on #124, so merge that first. Rewritten from what they do, with new tests written first: - the JMAP client: requests, the registry-write listener, batched gets and query paging - the auth, account, cache, schema and UI stores - the permissions hook, whose checks are now a plain function with tests - `types/jmap.ts` The client and the stores had little or no test coverage before; the new client and store tests were also run against the old code and pass there too. Storage keys (`inbuxa-auth`, `inbuxa-ui`), exports and behavior are unchanged. Removed because nothing used them: `jmapQuery`, the cache's per-type invalidation, the permissions hook's edition checks, and two unused JMAP types. The suite goes from 701 to 724 tests. | | Not upstream's | Upstream lines left | Dual headers | |---|---|---|---| | #124 | 79.7% | 15,098 in 62 files | 50 | | this PR | 81.5% | 13,775 in 51 files | 39 | That ends phase 3. The plan expected 81.4%. **Visual check:** see #124. That check covered both phase 3 PRs and found no change in the UI. Typecheck, lint, i18n:check, tests, build and notice check pass locally. No new strings.
jcoffey-dev added 2 commits 2026-10-19 02:08:35 +00:00
Rewrite sign-in, the callback and the API wrapper
ci / build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / notices (pull_request) Successful in 1m39s
ci / github (pull_request) Successful in 1m50s
8f01e828ac
OAuth (discovery, PKCE with S256, the redirect, the code trade, the
end-session URL), the client id, the login page, the callback and the API
wrapper are rewritten from what they do, with new tests: RFC 7636's worked
example for the challenge, the state check, refusal versus no answer on
refresh, a shared refresh, the retry after a 401.

The callback's checks move out of the page into services/auth/callback.ts,
where they are tested directly. Storage keys, the sign-in parameters,
strings and behavior are unchanged. Checked on a local server: a deep link
through sign-in, a refresh, sign-out and a forged callback.
Rewrite the JMAP client, the stores and the JMAP types
ci / build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 1m33s
ci / notices (pull_request) Successful in 1m36s
9d330d7ec5
The client, the auth, account, cache, schema and UI stores, the permissions
hook and types/jmap.ts are rewritten from their behavior, with new tests
for each (the client's and the store tests also pass on the old code).
Storage keys, exports and behavior are unchanged. Dropped, as unused:
jmapQuery, the cache's per-type invalidation, the permissions hook's
edition checks, and the JmapRequest and JmapGetResponse types.
jcoffey-dev merged commit 7a31b32130 into main 2026-10-19 02:10:51 +00:00
jcoffey-dev deleted branch phase3/data 2026-10-19 02:10:52 +00:00
Sign in to join this conversation.