From 7bb3133e266afa315f02d602017e1f223c74df88 Mon Sep 17 00:00:00 2001 From: Diogo Castro Date: Thu, 24 Feb 2022 20:23:50 +0100 Subject: [PATCH] Do not load files from cache (#6447) * Do not load files from cache * changelog --- changelog/unreleased/bugfix-do-not-load-from-cache | 6 ++++++ packages/web-app-draw-io/src/App.vue | 2 +- .../src/composables/appDefaults/useAppFileHandling.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 changelog/unreleased/bugfix-do-not-load-from-cache diff --git a/changelog/unreleased/bugfix-do-not-load-from-cache b/changelog/unreleased/bugfix-do-not-load-from-cache new file mode 100644 index 00000000000..06f1d4c4ab3 --- /dev/null +++ b/changelog/unreleased/bugfix-do-not-load-from-cache @@ -0,0 +1,6 @@ +Bugfix: Do not load files from cache + +When apps (i.e Drawio) try to load a file, the browser caches the request. +If the file was modified somewhere else, this causes inconsistent results which prevent saving any changes until the cache is properly cleared. + +https://github.com/owncloud/web/pull/6447 diff --git a/packages/web-app-draw-io/src/App.vue b/packages/web-app-draw-io/src/App.vue index 968c9cb2dc4..06761821bbb 100644 --- a/packages/web-app-draw-io/src/App.vue +++ b/packages/web-app-draw-io/src/App.vue @@ -137,7 +137,7 @@ export default { }) }, load() { - this.getFileContents(this.filePath, { resolveWithResponseObject: true }) + this.getFileContents(this.filePath) .then((resp) => { this.currentETag = resp.headers.ETag this.$refs.drawIoEditor.contentWindow.postMessage( diff --git a/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts b/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts index f78439256d0..7445079e979 100644 --- a/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts +++ b/packages/web-pkg/src/composables/appDefaults/useAppFileHandling.ts @@ -69,7 +69,8 @@ export function useAppFileHandling(options: AppFileHandlingOptions): AppFileHand } } else { return client.files.getFileContents(filePath, { - resolveWithResponseObject: true + resolveWithResponseObject: true, + noCache: true }) } }