Set response values to zero if None for /_synapse/admin/v1/federation/destinations (#16729)

release-v1.98
Will Hunt 2023-12-05 11:40:27 +00:00 committed by GitHub
parent 0bb8e418a4
commit ea783550bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
changelog.d/16729.bugfix Normal file
View File

@ -0,0 +1 @@
Fix GET /_synapse/admin/v1/federation/destinations returning null (instead of 0) for `retry_last_ts` and `retry_interval`.

View File

@ -89,8 +89,8 @@ class ListDestinationsRestServlet(RestServlet):
"destinations": [ "destinations": [
{ {
"destination": r[0], "destination": r[0],
"retry_last_ts": r[1], "retry_last_ts": r[1] or 0,
"retry_interval": r[2], "retry_interval": r[2] or 0,
"failure_ts": r[3], "failure_ts": r[3],
"last_successful_stream_ordering": r[4], "last_successful_stream_ordering": r[4],
} }