Skip to content

[M2.2e1a] Fix immutable SDK arrays and pagination schema - #63

Merged
samuelmbabhazi merged 2 commits into
mainfrom
fix/m2.2e1a-client-contract
Nov 5, 2026
Merged

samuelmbabhazi merged 2 commits into
mainfrom
fix/m2.2e1a-client-contract

Conversation

@samuelmbabhazi

Copy link
Copy Markdown
Collaborator

The first typed web consumer exposed two contract defects: token-list limit was generated as an object, and openapi-fetch's Readable/Writable helpers transformed readonly arrays into objects whose array methods were unusable. This blocked recovery-code and scope handling under strict TypeScript.

The pagination DTO now explicitly declares an integer schema. A version-pinned pnpm patch corrects only the helper package's three TypeScript declaration entry points, using homomorphic array mapping to preserve mutable/readonly arrays and tuples. Runtime JavaScript is unchanged, and no dependency version is downgraded. This addresses the confirmed upstream issue: openapi-ts/openapi-typescript#2615. Remove the patch after an upstream fix passes these regressions.

Validation: the new client typecheck failed before the fixes. API and client lint/typecheck/tests now pass (96 API tests, four client tests), API production build passes, and OpenAPI/client regeneration is current. Regression tests exercise numeric pagination, nested readonly response scopes and readonly request bodies; the HTTP OpenAPI test asserts the integer schema.

Security: no authentication semantics or runtime dependency code changes; no casts weakening the generated contract. Stacked on #62; no merge requested.

  • M2.2e1a criteria met
  • Compile-time and runtime regressions covered
  • Generated artifacts current
  • Temporary patch reason and removal condition documented

@samuelmbabhazi
samuelmbabhazi force-pushed the feat/m2.2d4c2b-token-management-http branch from e067c3c to df1810d Compare November 5, 2026 12:36
@samuelmbabhazi
samuelmbabhazi changed the base branch from feat/m2.2d4c2b-token-management-http to main November 5, 2026 12:36
@samuelmbabhazi
samuelmbabhazi force-pushed the fix/m2.2e1a-client-contract branch from 019269c to 486ab5b Compare November 5, 2026 12:37
@samuelmbabhazi
samuelmbabhazi merged commit 0e607cb into main Nov 5, 2026
9 checks passed
@samuelmbabhazi
samuelmbabhazi deleted the fix/m2.2e1a-client-contract branch November 5, 2026 12:37
samuelmbabhazi added a commit that referenced this pull request Nov 5, 2026
The web app now has a typed identity client covering account, MFA and
token-management endpoints, plus in-memory session state. Requests use
the generated SDK, stay on the current origin, refuse redirects/bearer
credentials, avoid caching, cap network waits at twenty seconds and
attach only an unambiguous CSRF cookie. Mutation callers supply their
retry keys so a UI can preserve a key across an uncertain result.

Session state retains only user ID, email and expiry, including when
accepting a response that also contains recovery codes or an API token.
A revision counter prevents stale requests from restoring signed-out
state. Failed logout remains visibly unconfirmed; missing credentials
and service outages have distinct states. UI errors use fixed safe
messages and bounded Retry-After values.

Validation: web lint/typecheck, all 11 Angular tests and production
build pass. Tests cover cookie/header behavior, cross-origin rejection,
duplicate/insecure CSRF cookies, empty responses, sanitized errors and
late session responses. The workspace SDK dependency is declared
alongside the existing root Angular dependencies so the Angular/Vitest
runner resolves it consistently.

Security: credentials remain in request bodies/headers and never enter
URLs or browser storage. No new external package/version; only an
existing workspace package is linked. Screens and real-browser
acceptance follow in M2.2e2–e4. Stacked on #63; no merge requested.

- [x] M2.2e1b criteria met
- [x] Web checks and race/security regressions pass
- [x] Plan/spec current
- [x] No secret persisted in session state
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