Skip to content

Commit b19b512

Browse files
authored
fix(frontend): fix Transcripts and Quotas missing in embedded Cloud UI sidebar (#2312)
Fix store update ordering race condition in refreshSupportedEndpoints(). The useApiStore subscription fires synchronously and calls updateSidebarItems(), which reads feature support from useSupportedFeaturesStore. By updating useSupportedFeaturesStore first, the subscription sees correct feature data.
1 parent 1c101d4 commit b19b512

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

frontend/src/state/backend-api.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,12 @@ const _apiCreator = (set: any, get: any) => ({
10221022
if (!r) {
10231023
return null;
10241024
}
1025-
set({ endpointCompatibility: r.endpointCompatibility });
1025+
// IMPORTANT: Update useSupportedFeaturesStore BEFORE useApiStore.
1026+
// The useApiStore subscription in config.ts fires synchronously and calls
1027+
// updateSidebarItems(), which reads feature support from useSupportedFeaturesStore.
1028+
// If useApiStore is updated first, the subscription sees stale feature data.
10261029
useSupportedFeaturesStore.getState().setEndpointCompatibility(r.endpointCompatibility);
1030+
set({ endpointCompatibility: r.endpointCompatibility });
10271031
return r;
10281032
} catch (err) {
10291033
// biome-ignore lint/suspicious/noConsole: intentional console usage

0 commit comments

Comments
 (0)