You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
autobot-slm-frontend/src/utils/ApiClient.ts (419L, ~380 transport — ~250-300 near-line-identical to main; its own docstring defers a shared core to 'a later ADR')
Shared: rawRequest (AbortController timeout + signal-forward + FormData + auth inject + 401 hook + base-URL join), get (retry+backoff, no-retry-4xx), post/put/patch/delete (204+content-type), extractErrorInfo, parseJsonBody, uploadFile (XHR progress — IDENTICAL between the two ApiClients).
Proposal: a createHttpClient(config) factory parameterized on the 5 axes that differ per app: baseUrl resolver, token source, 401 handler, auth-endpoint skip predicate, extra headers (X-Organization-Id main-only). Collapses ~300-380 lines.
Why an ADR (not execute-now): crosses the autobot-frontend ↔ autobot-slm-frontend package boundary (no @autobot/* workspace pkg exists yet — needs a shared-pkg/path-alias decision) and unifies security-sensitive 401/auth-storage behavior that currently differs per app on purpose. Recommend: land the bounded adapter de-dup first; do this after #12644 merges so all 3 clients exist to refactor together. Refs #12420, #12614.
Closing as subset of #12653 (this umbrella #12645's frontend cross-app duplication child, which covers the ApiClient/ssot-config/WS copy-adapt including the 3-client transport fork). Evidence + the createHttpClient/@autobot/http-core proposal moved to #12653. Refs #12645, #12653.
Activity
mrveiss commentedon Jul 26, 2026
Closing as subset of #12653 (this umbrella #12645's frontend cross-app duplication child, which covers the ApiClient/ssot-config/WS copy-adapt including the 3-client transport fork). Evidence + the createHttpClient/@autobot/http-core proposal moved to #12653. Refs #12645, #12653.