Fix missing aggregated info in real-time sync race for presence.

- Add aggregated info to real-time updated presence status.
- Update `presence events` test case with adding aggregated
  information to presence event.
- Add test case for updating presence status for user which
  send state from multiple clients.

Fixes #4282.
This commit is contained in:
K.Kanakhin
2017-04-25 15:50:30 +06:00
committed by Tim Abbott
parent 088d881159
commit 18f2a7428f
4 changed files with 44 additions and 18 deletions

View File

@@ -2344,7 +2344,7 @@ def send_presence_changed(user_profile, presence):
presence_dict = presence.to_dict()
event = dict(type="presence", email=user_profile.email,
server_timestamp=time.time(),
presence={presence_dict['client']: presence.to_dict()})
presence={presence_dict['client']: presence_dict})
send_event(event, active_user_ids(user_profile.realm))
def consolidate_client(client):