Fix issue with stale device lists (#2702)

We were only sending the last entry to the worker, so most likely missed
updates.
This commit is contained in:
Till 2022-09-08 12:03:44 +02:00 committed by GitHub
parent d5876abbe9
commit 42a82091a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 4 deletions

View file

@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"net/http"
"net/url"
"github.com/gorilla/mux"
"github.com/matrix-org/gomatrix"
@ -235,9 +236,17 @@ func federationClientError(err error) error {
return &api.FederationClientError{
Code: ferr.Code,
}
default:
case *url.Error: // e.g. certificate error, unable to connect
return &api.FederationClientError{
Err: err.Error(),
Err: ferr.Error(),
Code: 400,
}
default:
// We don't know what exactly failed, but we probably don't
// want to retry the request immediately in the device list updater
return &api.FederationClientError{
Err: err.Error(),
Code: 400,
}
}
}