mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Allow external processes to mark a user as syncing. (#812)
* Add infrastructure to the presence handler to track sync requests in external processes * Expire stale entries for dead external processes * Add an http endpoint for making users as syncing Add some docstrings and comments. * Fixes
This commit is contained in:
parent
fb2193cc63
commit
70599ce925
4 changed files with 174 additions and 22 deletions
|
@ -264,7 +264,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=True, user_to_num_current_syncs={}, now=now
|
||||
state, is_mine=True, syncing_user_ids=set(), now=now
|
||||
)
|
||||
|
||||
self.assertIsNotNone(new_state)
|
||||
|
@ -282,7 +282,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=True, user_to_num_current_syncs={}, now=now
|
||||
state, is_mine=True, syncing_user_ids=set(), now=now
|
||||
)
|
||||
|
||||
self.assertIsNotNone(new_state)
|
||||
|
@ -300,9 +300,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=True, user_to_num_current_syncs={
|
||||
user_id: 1,
|
||||
}, now=now
|
||||
state, is_mine=True, syncing_user_ids=set([user_id]), now=now
|
||||
)
|
||||
|
||||
self.assertIsNotNone(new_state)
|
||||
|
@ -321,7 +319,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=True, user_to_num_current_syncs={}, now=now
|
||||
state, is_mine=True, syncing_user_ids=set(), now=now
|
||||
)
|
||||
|
||||
self.assertIsNotNone(new_state)
|
||||
|
@ -340,7 +338,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=True, user_to_num_current_syncs={}, now=now
|
||||
state, is_mine=True, syncing_user_ids=set(), now=now
|
||||
)
|
||||
|
||||
self.assertIsNone(new_state)
|
||||
|
@ -358,7 +356,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=False, user_to_num_current_syncs={}, now=now
|
||||
state, is_mine=False, syncing_user_ids=set(), now=now
|
||||
)
|
||||
|
||||
self.assertIsNotNone(new_state)
|
||||
|
@ -377,7 +375,7 @@ class PresenceTimeoutTestCase(unittest.TestCase):
|
|||
)
|
||||
|
||||
new_state = handle_timeout(
|
||||
state, is_mine=True, user_to_num_current_syncs={}, now=now
|
||||
state, is_mine=True, syncing_user_ids=set(), now=now
|
||||
)
|
||||
|
||||
self.assertIsNotNone(new_state)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue