presence: Backend implementation of the last_update_id API.

This builds on top of 016880f54d which
maintains correct .last_update_id for UserPresence objects; now we add
the related API changes to utilize it.
This commit is contained in:
Mateusz Mandera
2024-06-05 21:36:22 +02:00
committed by Tim Abbott
parent a83dc572df
commit 512f4d1476
12 changed files with 340 additions and 28 deletions

View File

@@ -425,6 +425,11 @@ class BaseAction(ZulipTestCase):
state["realm_bots"] = {u["email"]: u for u in state["realm_bots"]}
# Since time is different for every call, just fix the value
state["server_timestamp"] = 0
if "presence_last_update_id" in state:
# We don't adjust presence_last_update_id via apply_events,
# since events don't carry the relevant information.
# Fix the value just like server_timestamp.
state["presence_last_update_id"] = 0
normalize(state1)
normalize(state2)