[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Mar 21 12:42:49 UTC 2019


 wsd/DocumentBroker.cpp |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit c459ad77a1f278dc51d947f6b2a5fa559f279612
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Thu Mar 21 14:25:15 2019 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Mar 21 14:36:46 2019 +0200

    tdf#124055: Idle timeout is pointless in mobile apps
    
    We don't want to unload the document and show any "Idle document -
    please click to reload and resume editing" overlay.
    
    What the iOS (and presumably Android) app *would* need, though, is
    proper restore functionality. I.e. if you have a document open, and
    the app is put in the background (i.e. the user does something else),
    and the OS kills it (as is perfectly normal for iOS or Android to do
    to idle background apps), then when the user returs to the app, it
    should reopen the same document and restore the view location and zoom
    level.

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index cc4068bc3..8524725ff 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -246,10 +246,11 @@ void DocumentBroker::pollThread()
     LOG_INF("Doc [" << _docKey << "] attached to child [" << _childProcess->getPid() << "].");
 
     static const bool AutoSaveEnabled = !std::getenv("LOOL_NO_AUTOSAVE");
+
+#if !MOBILEAPP
     static const size_t IdleDocTimeoutSecs = LOOLWSD::getConfigValue<int>(
                                                       "per_document.idle_timeout_secs", 3600);
 
-#if !MOBILEAPP
     // Used to accumulate B/W deltas.
     uint64_t adminSent = 0;
     uint64_t adminRecv = 0;
@@ -320,9 +321,11 @@ void DocumentBroker::pollThread()
             last30SecCheckTime = std::chrono::steady_clock::now();
         }
 
+        if (false)
+            ;
+#if !MOBILEAPP
         // Remove idle documents after 1 hour.
-        const bool idle = (isLoaded() && getIdleTimeSecs() >= IdleDocTimeoutSecs);
-        if (idle)
+        else if (isLoaded() && getIdleTimeSecs() >= IdleDocTimeoutSecs)
         {
             // Stop if there is nothing to save.
             LOG_INF("Autosaving idle DocumentBroker for docKey [" << getDocKey() << "] to kill.");
@@ -332,6 +335,7 @@ void DocumentBroker::pollThread()
                 stop("idle");
             }
         }
+#endif
         else if (_sessions.empty() && (isLoaded() || _markToDestroy))
         {
             // If all sessions have been removed, no reason to linger.


More information about the Libreoffice-commits mailing list