aboutsummaryrefslogtreecommitdiff
path: root/federationapi
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2022-09-07 11:44:27 +0200
committerGitHub <noreply@github.com>2022-09-07 11:44:27 +0200
commit440eb0f3a2e5aecddebe3e093d5740ce5c4505c2 (patch)
tree7d141e3fdbc7c53f314110ed00b6b6d39eeb7a98 /federationapi
parent847032df36086ff6f383bcc4c332c391e86eaec8 (diff)
Handle errors differently in the `DeviceListUpdater` (#2695)
`If a device list update goes missing, the server resyncs on the next one` was failing because a previous test would receive a `waitTime` of 1h, resulting in the test timing out. This now tries to handle the returned errors differently, e.g. by using the default `waitTime` of 2s. Also doesn't try further users in the list, if one of the errors would cause a longer `waitTime`.
Diffstat (limited to 'federationapi')
-rw-r--r--federationapi/storage/shared/storage_edus.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/federationapi/storage/shared/storage_edus.go b/federationapi/storage/shared/storage_edus.go
index ce9632ed..e0c740c1 100644
--- a/federationapi/storage/shared/storage_edus.go
+++ b/federationapi/storage/shared/storage_edus.go
@@ -53,9 +53,9 @@ func (d *Database) AssociateEDUWithDestination(
// Keep EDUs for at least x minutes before deleting them
expiresAt = gomatrixserverlib.AsTimestamp(time.Now().Add(duration))
}
- // We forcibly set m.direct_to_device events to 0, as we always want them
- // to be delivered. (required for E2EE)
- if eduType == gomatrixserverlib.MDirectToDevice {
+ // We forcibly set m.direct_to_device and m.device_list_update events
+ // to 0, as we always want them to be delivered. (required for E2EE)
+ if eduType == gomatrixserverlib.MDirectToDevice || eduType == gomatrixserverlib.MDeviceListUpdate {
expiresAt = 0
}
return d.Writer.Do(d.DB, nil, func(txn *sql.Tx) error {