mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:14:52 -04:00
Fix message duplication if something goes wrong after persisting the event (#8476)
Should fix #3365.
This commit is contained in:
parent
a9a8f29729
commit
b2486f6656
13 changed files with 481 additions and 32 deletions
|
@ -254,17 +254,24 @@ class HomeserverTestCase(TestCase):
|
|||
if hasattr(self, "user_id"):
|
||||
if self.hijack_auth:
|
||||
|
||||
# We need a valid token ID to satisfy foreign key constraints.
|
||||
token_id = self.get_success(
|
||||
self.hs.get_datastore().add_access_token_to_user(
|
||||
self.helper.auth_user_id, "some_fake_token", None, None,
|
||||
)
|
||||
)
|
||||
|
||||
async def get_user_by_access_token(token=None, allow_guest=False):
|
||||
return {
|
||||
"user": UserID.from_string(self.helper.auth_user_id),
|
||||
"token_id": 1,
|
||||
"token_id": token_id,
|
||||
"is_guest": False,
|
||||
}
|
||||
|
||||
async def get_user_by_req(request, allow_guest=False, rights="access"):
|
||||
return create_requester(
|
||||
UserID.from_string(self.helper.auth_user_id),
|
||||
1,
|
||||
token_id,
|
||||
False,
|
||||
False,
|
||||
None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue