mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #77 from overleaf/bg-minimal-connected-users-fix
only show connected users with a user_id
This commit is contained in:
commit
59886a980b
3 changed files with 3 additions and 2 deletions
|
@ -60,7 +60,7 @@ module.exports =
|
|||
|
||||
_getConnectedUser: (project_id, client_id, callback)->
|
||||
rclient.hgetall Keys.connectedUser({project_id, client_id}), (err, result)->
|
||||
if !result? or Object.keys(result).length == 0
|
||||
if !result? or Object.keys(result).length == 0 or !result.user_id
|
||||
result =
|
||||
connected : false
|
||||
client_id:client_id
|
||||
|
|
|
@ -124,7 +124,7 @@ describe "ConnectedUsersManager", ->
|
|||
|
||||
it "should return a connected user if there is a user object", (done)->
|
||||
cursorData = JSON.stringify(cursorData:{row:1})
|
||||
@rClient.hgetall.callsArgWith(1, null, {connected_at:new Date(), cursorData})
|
||||
@rClient.hgetall.callsArgWith(1, null, {connected_at:new Date(), user_id: @user._id, last_updated_at: "#{Date.now()}", cursorData})
|
||||
@ConnectedUsersManager._getConnectedUser @project_id, @client_id, (err, result)=>
|
||||
result.connected.should.equal true
|
||||
result.client_id.should.equal @client_id
|
||||
|
|
|
@ -17,6 +17,7 @@ describe "WebsocketLoadBalancer", ->
|
|||
"./HealthCheckManager": {check: sinon.stub()}
|
||||
"./RoomManager" : @RoomManager = {eventSource: sinon.stub().returns @RoomEvents}
|
||||
"./ChannelManager": @ChannelManager = {publish: sinon.stub()}
|
||||
"./ConnectedUsersManager": @ConnectedUsersManager = {refreshClient: sinon.stub()}
|
||||
@io = {}
|
||||
@WebsocketLoadBalancer.rclientPubList = [{publish: sinon.stub()}]
|
||||
@WebsocketLoadBalancer.rclientSubList = [{
|
||||
|
|
Loading…
Reference in a new issue