Skip to content

feat(web): standardize fetch client and add IndexedDB query cache persistence - #1137

Merged
TheGreatAxios merged 4 commits into
mainfrom
cl-10999-consolidate-web-fetch-client
Oct 21, 2026
Merged

TheGreatAxios merged 4 commits into
mainfrom
cl-10999-consolidate-web-fetch-client

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Closes CL-10999

Summary

  • Consolidate duplicate fetch + ArkType + error-envelope wrappers across apps/web/src (api.ts, settings/api.ts, settings/tenancy-api.ts, settings/credentials-api.ts, settings/inference/api.ts, settings/inference/oauth-login.ts, agents-api.ts, skills-api.ts, chat/threads-api.ts, routines-api.ts, and bench/tenant-config.ts) onto the shared apiRequest and requestVoid primitives.
  • Make all domain API error classes (SettingsApiError, TenancyApiError, CredentialsApiError, InferenceSettingsApiError, ChatApiError) extend ApiQueryError so status-aware query retry (shouldRetryQuery), auth invalidation (isAuthInvalidError), and toAPIQuery work uniformly across every seam.
  • Add IndexedDB-backed TanStack Query cache persistence (apps/web/src/query-cache-persistence.ts) and keep bench-scoped queries cached across bench switches so switching benches or reloading reuses cached tenant data immediately while revalidating in the background.
  • Clear persisted query cache entries on sign-out and session invalidation.

Docs

  • Internal client architecture consolidation under apps/web/src; no user-facing routes, screens, or options changed.

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

CL-10999

@TheGreatAxios
TheGreatAxios enabled auto-merge (squash) October 21, 2026 04:28
@corbits-triage

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

Triage will approve, request review.

@TheGreatAxios
TheGreatAxios merged commit a51dd45 into main Oct 21, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant