Merge pull request #8170 from huffman/fix/multiple-sessions

Fix multiple sessions being created for some users
This commit is contained in:
Stephen Birarda 2016-07-01 16:41:56 -07:00 committed by GitHub
commit e784d7c400
2 changed files with 3 additions and 16 deletions

View file

@ -79,10 +79,6 @@ void DiscoverabilityManager::updateLocation() {
const QString FRIENDS_ONLY_KEY_IN_LOCATION = "friends_only";
locationObject.insert(FRIENDS_ONLY_KEY_IN_LOCATION, (_mode.get() == Discoverability::Friends));
// if we have a session ID add it now, otherwise add a null value
auto sessionID = accountManager->getSessionID();
rootObject[SESSION_ID_KEY] = sessionID.isNull() ? QJsonValue() : sessionID.toString();
JSONCallbackParameters callbackParameters;
callbackParameters.jsonCallbackReceiver = this;
callbackParameters.jsonCallbackMethod = "handleHeartbeatResponse";
@ -110,13 +106,8 @@ void DiscoverabilityManager::updateLocation() {
callbackParameters.jsonCallbackReceiver = this;
callbackParameters.jsonCallbackMethod = "handleHeartbeatResponse";
QJsonObject heartbeatObject;
auto sessionID = accountManager->getSessionID();
heartbeatObject[SESSION_ID_KEY] = sessionID.isNull() ? QJsonValue() : sessionID.toString();
accountManager->sendRequest(API_USER_HEARTBEAT_PATH, AccountManagerAuth::Optional,
QNetworkAccessManager::PutOperation, callbackParameters,
QJsonDocument(heartbeatObject).toJson());
QNetworkAccessManager::PutOperation, callbackParameters);
}
}

View file

@ -220,12 +220,8 @@ void AccountManager::sendRequest(const QString& path,
networkRequest.setHeader(QNetworkRequest::UserAgentHeader, _userAgentGetter());
// if we're allowed to send usage data, include whatever the current session ID is with this request
auto& activityLogger = UserActivityLogger::getInstance();
if (activityLogger.isEnabled()) {
networkRequest.setRawHeader(METAVERSE_SESSION_ID_HEADER,
uuidStringWithoutCurlyBraces(_sessionID).toLocal8Bit());
}
networkRequest.setRawHeader(METAVERSE_SESSION_ID_HEADER,
uuidStringWithoutCurlyBraces(_sessionID).toLocal8Bit());
QUrl requestURL = _authURL;