Skip to content

Commit

Permalink
fix: use resolved server data in non-streaming mode (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajwootto authored Dec 3, 2024
1 parent f06db52 commit 3ce09e5
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,17 @@ export const InternalDevCycleClientsideProvider = ({
})

if (!enableStreaming) {
const resolvedServerData = use(serverDataPromise)
// we expect that either the promise has resolved and we got the server data that way, or we weren't in
// streaming mode and so the promise was awaited at a higher level and passed in here as serverData
if (!resolvedServerData) {
// we expect that in non-streaming mode, the serverside portion of this provider should have awaited
// the serverDataPromise and passed in the result here
if (!serverData) {
throw new Error(
'Server data should be available. Please contact DevCycle support.',
)
}
clientRef.current.synchronizeBootstrapData(
resolvedServerData.config,
resolvedServerData.user,
resolvedServerData.userAgent,
serverData.config,
serverData.user,
serverData.userAgent,
)
}
}
Expand Down

0 comments on commit 3ce09e5

Please sign in to comment.