From c0e2ccd431d7c8e9b050419c7c047e2bb41ec756 Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Mon, 21 Sep 2026 23:08:27 +0200 Subject: [PATCH 1/2] Fix race condition in photos picker Signed-off-by: Marcel Robitaille --- src/components/PersonalSettings.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/PersonalSettings.vue b/src/components/PersonalSettings.vue index c44b8714..dcfa1968 100644 --- a/src/components/PersonalSettings.vue +++ b/src/components/PersonalSettings.vue @@ -830,7 +830,8 @@ export default { const url = generateUrl('/apps/integration_google/picker-session') axios.get(url, { params: { sessionId: this.pickerSessionId } }) .then((response) => { - if (response.data.mediaItemsSet === true && !this.startingPhotoImport) { + // Check pickerSessionId again to fix race condition (could have changed in the meantime) + if (response.data.mediaItemsSet === true && !this.startingPhotoImport && this.pickerSessionId) { this.onImportPhotos() } }) From add49292313055b75112937307b7bc8d3ed24ebb Mon Sep 17 00:00:00 2001 From: Lukas Schaefer Date: Wed, 23 Sep 2026 20:44:29 +0200 Subject: [PATCH 2/2] Implement review comments Co-authored-by: Marcel Robitaille Signed-off-by: Lukas Schaefer --- src/components/PersonalSettings.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/PersonalSettings.vue b/src/components/PersonalSettings.vue index dcfa1968..6a0392a1 100644 --- a/src/components/PersonalSettings.vue +++ b/src/components/PersonalSettings.vue @@ -827,11 +827,16 @@ export default { if (!this.pickerSessionId) { return } + + // Save the picker session ID to throw out the response if it changed since the request was made + // There's a race condition if onImportPhotos resolved in the meantime + const pickerSessionIdOfRequest = this.pickerSessionId + const url = generateUrl('/apps/integration_google/picker-session') axios.get(url, { params: { sessionId: this.pickerSessionId } }) .then((response) => { // Check pickerSessionId again to fix race condition (could have changed in the meantime) - if (response.data.mediaItemsSet === true && !this.startingPhotoImport && this.pickerSessionId) { + if (response.data.mediaItemsSet === true && !this.startingPhotoImport && (pickerSessionIdOfRequest === this.pickerSessionId)) { this.onImportPhotos() } })