We do the key upload asynchronously without awaiting it. This means we
may do multiple syncs before the key upload finishes. So we may generate
more keys than we should.
To fix that prevent multiple key uploads from running at once. This may
lead to outdated key uploads in some cases if we miss an OTK being used
in sync. However, the next sync will still tell us about that so in the
worst case this might delay key uploads by 30s (with the default sync
timeout), which for normal usage should be completely acceptable.
This was added in 77be6102f6 without much
documentation. I am pretty sure the intent was never to slow down every
test by 5 seconds, so let's get rid of it and do more careful delays
where it is useful (like specific sync requests for example).
Makes the tests run 5 times faster (the whole suite!) on my device.
When decrypting the last event for archived rooms when a room key is
received, we used to send a synthetic SyncUpdate. This however put the
archived room into the join section, which converted the room to a
joined room. We need to respect what section the room was in when
sending synthetic SyncUpdates.
fixes https://github.com/famedly/matrix-dart-sdk/issues/1916
This was triggered by some archive decryption test I was writing and
possibly also is triggered in production a few times. Waiting for
running transactions to complete before closing sounds sensible.
This should speed up loading the archived rooms. One of the reasons it
was so slow, is because we were loading all room members!
Additionally this may work around a bug in Synapse, where rooms stuck in
their partial state may block sync indefinitely.
Relates to https://github.com/famedly/product-management/issues/2250
- BREAKING: create `DatabaseApi.storeWellKnown` method
- BREAKING: create `DatabaseApi.getWellKnown` method
- add new getter `Client.wellKnown` containing cached `DiscoveryInformation`
- override `Client.homeserver` to invalidate `Client.wellKnown` in case the domain changed
- override `Client.getWellknown` to cache the resolved `DiscoveryInformation`
- add tests for well-known cache
Fixes: #1865
Signed-off-by: The one with the braid <info@braid.business>
Synapse includes the room in both sections if you have both an
invite->leave and a leave->invite transition in one sync response.
Transitions in the other order are only included once (in the leave
section) it seems, so this should work correctly in all cases.
Fixes https://github.com/famedly/product-management/issues/2283