From 762ca3d3ed613da7a3132192fe535233e1547a9e Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Fri, 10 Apr 2020 09:36:43 -0400 Subject: [PATCH] wsd: don't reset modified flag on storing the doc The modified flag should only be changed by Core, otherwise, we suffer a race and really make the significance of this flag ambiguous. Change-Id: I1fef90f377f9e3ae66b9046c99a428e5ce46e536 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92100 Tested-by: Jenkins CollaboraOffice Reviewed-by: Ashod Nakashian --- wsd/DocumentBroker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index d9fc339c9..fd1dc7f46 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -984,7 +984,7 @@ bool DocumentBroker::saveToStorageInternal(const std::string& sessionId, bool su const auto timeInSec = std::chrono::duration_cast (std::chrono::system_clock::now() - _lastFileModifiedTime); LOG_DBG("Skipping unnecessary saving to URI [" << uriAnonym << "] with docKey [" << _docKey << - "]. File last modified " << timeInSec.count() << " seconds ago."); + "]. File last modified " << timeInSec.count() << " seconds ago, timestamp unchanged."); _poll->wakeup(); return true; } @@ -1005,7 +1005,6 @@ bool DocumentBroker::saveToStorageInternal(const std::string& sessionId, bool su if (!isSaveAs && !isRename) { // Saved and stored; update flags. - setModified(false); _lastFileModifiedTime = newFileModifiedTime; _lastSaveTime = std::chrono::steady_clock::now(); @@ -2013,6 +2012,7 @@ void DocumentBroker::setModified(const bool value) #endif } + // Set the X-LOOL-WOPI-IsModifiedByUser header flag sent to storage. _storage->setUserModified(value); }