Skip to content

Commit d98f13c

Browse files
authored
Merge pull request #1312 from nextcloud/fix/always-refetch-capabilities
fix(app): always re-fetch capabilities and user data on launch
2 parents f8fa223 + 11aac02 commit d98f13c

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/app/appData.service.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,12 @@ export async function refetchAppData(appData, persist = false) {
3333
}
3434

3535
/**
36-
* If talk hash is dirty, re-fetch capabilities and userMetadata and update appData
36+
* Re-fetch capabilities and userMetadata with retry and update appData
3737
*
3838
* @param {import('./AppData.js').appData} appData appData
3939
* @return {Promise<void>}
40-
* @throws {Error}
4140
*/
42-
export async function refetchAppDataIfDirty(appData) {
43-
// Re-fetch on dirty Talk hash and any desktop client upgrade
44-
if (!appData.talkHashDirty && packageJson.version === appData.version.desktop) {
45-
return
46-
}
47-
41+
export async function refetchAppDataWithRetry(appData) {
4842
await new Promise((resolve) => {
4943
/**
5044
* Try to re-fetch appData

src/welcome/welcome.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { appData } from '../app/AppData.js'
7-
import { refetchAppDataIfDirty } from '../app/appData.service.js'
7+
import { refetchAppDataWithRetry } from '../app/appData.service.js'
88
import { initGlobals } from '../shared/globals/globals.js'
99
import { applyAxiosInterceptors } from '../shared/setupWebPage.js'
1010

@@ -31,7 +31,7 @@ applyAxiosInterceptors()
3131

3232
if (appData.credentials) {
3333
await window.TALK_DESKTOP.enableWebRequestInterceptor(appData.serverUrl, { credentials: appData.credentials })
34-
await refetchAppDataIfDirty(appData)
34+
await refetchAppDataWithRetry(appData)
3535
}
3636

3737
window.TALK_DESKTOP.sendAppData(appData.toJSON())

0 commit comments

Comments
 (0)