Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion server/connections.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,14 @@ Meteor.methods({
if ((token = Accounts._getLoginToken(this.connection.id))) {
// This $pulls tokens from services.resume.loginTokens, and should work
// in the same way that Accounts._expireTokens effects cleanup.
Accounts.destroyToken(userId, token);
//
// We run this in a deferred function so that the login credential update
// doesn't hit the write fence on this method call, making it less
// likely for the client to get logged out (and see an error) before
// the HIT actually submits. This should fix, or at least improve, the
// race condition causing
// https://github.com/TurkServer/turkserver-meteor/issues/28
Meteor.setTimeout(() => Accounts.destroyToken(userId, token), 1000);
}

// return true to auto submit the HIT
Expand Down