fix(app): creation page waits for own grants; e2e never prints setup keys

Delta verifier: two remaining setup-key assertions now booleans. Its observation: the editor rule read grants before they loaded; authStore.catalogGrantsStatus (loading, ready, failed): the page waits, and a failed read leaves the decision to the server. App 654, e2e:ui 227, admin shell spec 14 + 6 skipped.
This commit is contained in:
bchanot committed 2026-11-02 18:33:57 +01:00
1 parent 02625a76b6
commit f04bfdd040
6 files changed
+37 -11

No files matched your search

+6 -2
View File
@@ -68,6 +68,8 @@ export interface AuthState {
* Empty until loaded and when the read fails.
*/
catalogGrants: OwnCatalogGrant[]
/** Whether `catalogGrants` is read yet: a display rule waits for `ready`, and a `failed` read leaves the decision to the server. */
catalogGrantsStatus: 'loading' | 'ready' | 'failed'
/** Subscribes to the client; returns the unsubscribe. Safe to call twice. */
start: () => () => void
refreshAccount: () => Promise<void>
@@ -150,8 +152,8 @@ async function loadAccount(client: FaunosteoClient, user: User, set: Set, get: G
loadWorkspace(client, user, profile, setOwn, get),
syncAvatar(client, user, setOwn, get).catch(() => setOwn({ avatar: null })),
listOwnCatalogGrants(client, user.id)
.then((catalogGrants) => setOwn({ catalogGrants }))
.catch(() => setOwn({ catalogGrants: [] })),
.then((catalogGrants) => setOwn({ catalogGrants, catalogGrantsStatus: 'ready' }))
.catch(() => setOwn({ catalogGrants: [], catalogGrantsStatus: 'failed' })),
])
}
@@ -165,6 +167,7 @@ function accountReset(get: Get): Partial<AuthState> {
avatarUrl: null,
workspace: { status: 'idle' },
catalogGrants: [],
catalogGrantsStatus: 'loading',
}
}
@@ -236,6 +239,7 @@ export const useAuthStore = create<AuthState>((set, get) => ({
avatarUrl: null,
workspace: { status: 'idle' },
catalogGrants: [],
catalogGrantsStatus: 'loading',
start: () => {
const client = getSupabaseClient()