mirror of https://github.com/vector-im/riot-web
Merge pull request #27758 from element-hq/travis/add-serviceworker-debug
Add debugging for service worker version checkpull/27766/head
commit
dd685934a3
|
@ -102,11 +102,15 @@ async function tryUpdateServerSupportMap(clientApiUrl: string, accessToken?: str
|
||||||
|
|
||||||
const config = fetchConfigForToken(accessToken);
|
const config = fetchConfigForToken(accessToken);
|
||||||
const versions = await (await fetch(`${clientApiUrl}/_matrix/client/versions`, config)).json();
|
const versions = await (await fetch(`${clientApiUrl}/_matrix/client/versions`, config)).json();
|
||||||
|
console.log(`[ServiceWorker] /versions response for '${clientApiUrl}': ${JSON.stringify(versions)}`);
|
||||||
|
|
||||||
serverSupportMap[clientApiUrl] = {
|
serverSupportMap[clientApiUrl] = {
|
||||||
supportsAuthedMedia: Boolean(versions?.versions?.includes("v1.11")),
|
supportsAuthedMedia: Boolean(versions?.versions?.includes("v1.11")),
|
||||||
cacheExpiryTimeMs: new Date().getTime() + 2 * 60 * 60 * 1000, // 2 hours from now
|
cacheExpiryTimeMs: new Date().getTime() + 2 * 60 * 60 * 1000, // 2 hours from now
|
||||||
};
|
};
|
||||||
|
console.log(
|
||||||
|
`[ServiceWorker] serverSupportMap update for '${clientApiUrl}': ${JSON.stringify(serverSupportMap[clientApiUrl])}`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ideally we'd use the `Client` interface for `client`, but since it's not available (see 'fetch' listener), we use
|
// Ideally we'd use the `Client` interface for `client`, but since it's not available (see 'fetch' listener), we use
|
||||||
|
|
Loading…
Reference in New Issue