MCPcopy Create free account
hub / github.com/bytebase/bytebase / doRefresh

Function doRefresh

frontend/src/connect/refreshToken.ts:27–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27async function doRefresh(): Promise<void> {
28 if (await tryAcquireAndRefresh()) {
29 return;
30 }
31
32 // Another tab is refreshing - wait for broadcast
33 const receivedBroadcast = await waitForBroadcast();
34
35 // Only retry if timed out (missed broadcast or other tab failed)
36 if (!receivedBroadcast) {
37 await tryAcquireAndRefresh();
38 }
39}
40
41async function tryAcquireAndRefresh(): Promise<boolean> {
42 return navigator.locks.request(

Callers 1

refreshTokensFunction · 0.85

Calls 2

tryAcquireAndRefreshFunction · 0.85
waitForBroadcastFunction · 0.85

Tested by

no test coverage detected