wsd: Ignore useractive, userinactive when doc is not loaded

Sometimes client sends a userinactive message while the document is
already being loaded, which leads to the kit process skipping sending
the result of LOK callbacks to the client.

Handling this in child session is futile in the case when userinactive
message is sent when the document is being loaded, since kit process
handles the 'userinactive' message only after document is loaded (i.e
isLoaded() returns true). Moving this handling to DocumentBroker will
take care of both the cases - when 'userinactive' is sent before load
starts, and during load of the document.

Change-Id: I4ea3ac7b184d2ca373eb3ff4fb7b4ae394d454df
This commit is contained in:
Pranav Kant 2017-08-11 23:10:34 +05:30
parent 8c74d4a38d
commit ef54b6ea16
2 changed files with 6 additions and 7 deletions

View file

@ -183,13 +183,6 @@ bool ChildSession::_handleInput(const char *buffer, int length)
}
else if (!_isDocLoaded)
{
// Be forgiving to these messages while we load.
if (tokens[0] == "useractive" ||
tokens[0] == "userinactive")
{
return true;
}
sendTextFrame("error: cmd=" + tokens[0] + " kind=nodocloaded");
return false;
}

View file

@ -1316,6 +1316,12 @@ bool DocumentBroker::forwardToChild(const std::string& viewId, const std::string
{
assertCorrectThread();
// Ignore userinactive, useractive message until document is loaded
if (!isLoaded() && (message == "userinactive" || message == "useractive"))
{
return true;
}
LOG_TRC("Forwarding payload to child [" << viewId << "]: " << message);
std::string msg = "child-" + viewId + ' ' + message;