Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

Commit 27caa7d

Browse files
committed
fix(console): count the /i18n reads in the settle signal, as the data adapter's own fetch does (objectui#12034)
The adapter's request path is withSettleSignal(createAuthenticatedFetch()); the two /i18n reads now take the whole of it, so an automated driver's idle predicate waits for the application's translations too. Claude-Session: https://claude.ai/code/session_01MgfduSkFrfM3eorB3UGfAU Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8236058 commit 27caa7d

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

‎.changeset/12034-console-i18n-after-signin.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ The console's sign-in page no longer reads `/api/v1/i18n`, and the application's
77
The two loaders the console hands to `I18nProvider` used to run as soon as the page loaded, before the session was known, with a bare `fetch`. So the sign-in page read `/api/v1/i18n/translations/:locale` and `/api/v1/i18n/locales` as an anonymous caller, and a signed-in page load sent no bearer with them. Where no session cookie rides along (a console built with an absolute `VITE_SERVER_URL`), a framework that refuses an anonymous `/i18n` read (objectstack-ai/objectstack#22432) answers both with 401, and a signed-in user's application labels stay in the language they were authored in.
88

99
- **Signed out:** neither loader sends a request. The sign-in page renders from the built-in language packs.
10-
- **Signed in:** both loaders wait for the console's `AuthProvider` to answer for the page load, then read through `createAuthenticatedFetch()`, the request path the data adapter uses (bearer, `X-Tenant-ID`, `Accept-Language`). Every console sign-in ends in a full-page navigation, so the page load after sign-in is the one that reads them.
10+
- **Signed in:** both loaders wait for the console's `AuthProvider` to answer for the page load, then read through `withSettleSignal(createAuthenticatedFetch())`, the request path the data adapter uses (bearer, `X-Tenant-ID`, `Accept-Language`, and the in-flight count `window.__objectui` reports). Every console sign-in ends in a full-page navigation, so the page load after sign-in is the one that reads them.
1111

1212
Nothing published changes: no export, prop or language-pack key is added, and `I18nProvider` is used through its existing `loadLanguage` and `loadLocales` props.

‎apps/console/src/i18nSession.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
*
2020
* - Signed out: no request. The sign-in page renders from the built-in
2121
* language packs alone.
22-
* - Signed in: the read goes through `createAuthenticatedFetch()`, the request
23-
* path the data adapter uses for every signed-in read (bearer, `X-Tenant-ID`,
24-
* `Accept-Language`, session-rotation adoption).
22+
* - Signed in: the read goes through `withSettleSignal(createAuthenticatedFetch())`,
23+
* the request path the data adapter uses for every signed-in read (bearer,
24+
* `X-Tenant-ID`, `Accept-Language`, session-rotation adoption, and the
25+
* in-flight count an automated driver waits on).
2526
* - Not answered yet (the provider's `isLoading`): the loader waits. The wait
2627
* ends when the session read does, and it never rejects.
2728
*
@@ -34,6 +35,7 @@
3435
* navigation, would keep the built-in packs until the next page load.
3536
*/
3637
import { createAuthenticatedFetch, type AuthState } from '@object-ui/auth';
38+
import { withSettleSignal } from '@object-ui/app-shell';
3739

3840
/** `null` while the session is unanswered: before the first read, and while it re-resolves. */
3941
let signedIn: boolean | null = null;
@@ -64,5 +66,5 @@ export function whenSessionAnswered(): Promise<boolean> {
6466
});
6567
}
6668

67-
/** The data adapter's own authenticated request path, for the two `/i18n` reads. */
68-
export const i18nFetch = createAuthenticatedFetch();
69+
/** The data adapter's own request path (`AdapterProvider`), for the two `/i18n` reads. */
70+
export const i18nFetch = withSettleSignal(createAuthenticatedFetch());

0 commit comments

Comments
 (0)