wsd/ClientSession.cpp  |    6 ------
 wsd/DocumentBroker.cpp |    3 ---
 wsd/DocumentBroker.hpp |    5 -----
 3 files changed, 14 deletions(-)

New commits:
commit e83e36bd9b96fe38ac1f53f56d9754e26bd131e0
Author:     Tamás Zolnai <tamas.zol...@collabora.com>
AuthorDate: Thu Aug 13 17:29:17 2020 +0200
Commit:     Tamás Zolnai <tamas.zol...@collabora.com>
CommitDate: Thu Aug 13 17:35:02 2020 +0200

    Revert "Don't update modified status after saving to storage fails"
    
    The reverted change breaks unit-wopi-documentconflict test.
    
    This reverts commit 494a5221f5bb959f2cce19bc3dd662ac22027e0c.
    
    Change-Id: I3e89a6e6526e9388e4dc6a1ea8f8d8832e8cb169
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100678
    Tested-by: Tamás Zolnai <tamas.zol...@collabora.com>
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>

diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp
index 0ed783f72..a3fa8e078 100644
--- a/wsd/ClientSession.cpp
+++ b/wsd/ClientSession.cpp
@@ -1317,12 +1317,6 @@ bool ClientSession::handleKitToClientMessage(const char* 
buffer, const int lengt
         StringVector stateTokens(Util::tokenize(tokens[1], '='));
         if (stateTokens.size() == 2 && stateTokens.equals(0, 
".uno:ModifiedStatus"))
         {
-            // When the document is saved internally, but saving to storage 
failed,
-            // don't update the client's modified status
-            // (otherwise client thinks document is unmodified b/c saving was 
successful)
-            if (!docBroker->isLastStorageSaveSuccessful())
-                return false;
-
             docBroker->setModified(stateTokens.equals(1, "true"));
         }
         else
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index f89ed6953..a5e62fcc4 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -176,7 +176,6 @@ DocumentBroker::DocumentBroker(ChildType type,
     _docKey(docKey),
     _docId(Util::encodeId(DocBrokerId++, 3)),
     _documentChangedInStorage(false),
-    _lastStorageSaveSuccessful(true),
     _lastSaveTime(std::chrono::steady_clock::now()),
     _lastSaveRequestTime(std::chrono::steady_clock::now() - 
std::chrono::milliseconds(COMMAND_TIMEOUT_MS)),
     _markToDestroy(false),
@@ -1050,7 +1049,6 @@ bool DocumentBroker::saveToStorageInternal(const 
std::string& sessionId, bool su
     assert(_storage && _tileCache);
     const StorageBase::SaveResult storageSaveResult = 
_storage->saveLocalFileToStorage(
         auth, it->second->getCookies(), *_lockCtx, saveAsPath, saveAsFilename, 
isRename);
-    _lastStorageSaveSuccessful = storageSaveResult.getResult() == 
StorageBase::SaveResult::OK;
     if (storageSaveResult.getResult() == StorageBase::SaveResult::OK)
     {
 #if !MOBILEAPP
@@ -2476,7 +2474,6 @@ void DocumentBroker::dumpState(std::ostream& os)
     os << "\n  last saved: " << Util::getSteadyClockAsString(_lastSaveTime);
     os << "\n  last save request: " << 
Util::getSteadyClockAsString(_lastSaveRequestTime);
     os << "\n  last save response: " << 
Util::getSteadyClockAsString(_lastSaveResponseTime);
-    os << "\n  last storage save was successful: " << 
isLastStorageSaveSuccessful();
     os << "\n  last modified: " << 
Util::getHttpTime(_documentLastModifiedTime);
     os << "\n  file last modified: " << 
Util::getHttpTime(_lastFileModifiedTime);
     if (_limitLifeSeconds)
diff --git a/wsd/DocumentBroker.hpp b/wsd/DocumentBroker.hpp
index e59a2d6b4..b8e176b3c 100644
--- a/wsd/DocumentBroker.hpp
+++ b/wsd/DocumentBroker.hpp
@@ -175,8 +175,6 @@ public:
 
     bool isDocumentChangedInStorage() { return _documentChangedInStorage; }
 
-    bool isLastStorageSaveSuccessful() { return _lastStorageSaveSuccessful; }
-
     /// Save the document to Storage if it needs persisting.
     bool saveToStorage(const std::string& sesionId, bool success, const 
std::string& result = "", bool force = false);
 
@@ -406,9 +404,6 @@ private:
     /// for user's command to act.
     bool _documentChangedInStorage;
 
-    /// Indicates whether the last saveToStorage operation was successful.
-    bool _lastStorageSaveSuccessful;
-
     /// The last time we tried saving, regardless of whether the
     /// document was modified and saved or not.
     std::chrono::steady_clock::time_point _lastSaveTime;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to