From e22d2e4169fed53dc78b285a8a8c5ed5f4c1009a Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 15 Apr 2026 10:14:15 -0400 Subject: [PATCH] fix: filter out expired errors, show error type (in or out) in template --- src/controllers/admin/federation.js | 5 ++++- src/views/admin/federation/errors.tpl | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/controllers/admin/federation.js b/src/controllers/admin/federation.js index d94dd0726c..4b9aa604e0 100644 --- a/src/controllers/admin/federation.js +++ b/src/controllers/admin/federation.js @@ -90,6 +90,9 @@ federationController.errors = async function (req, res) { let errors = await db.getSortedSetRevRangeByScoreWithScores('ap.errors', 0, -1, Date.now(), '-inf'); const errorObj = await db.getObjects(errors.map(({ value: id }) => `ap.errors:${id}`)); errors = errors.map(({ value: id, score: timestamp }, idx) => { + if (!errorObj[idx]) { + return null; + } let { body, stack } = errorObj[idx]; let hostname = 'Invalid hostname'; const timestampISO = new Date(timestamp).toISOString(); @@ -101,7 +104,7 @@ federationController.errors = async function (req, res) { } return { id, body, stack, hostname, timestamp, timestampISO }; - }); + }).filter(Boolean); res.render('admin/federation/errors', { title: '[[admin/menu:federation/errors]]', diff --git a/src/views/admin/federation/errors.tpl b/src/views/admin/federation/errors.tpl index 8af5c18945..ad85844ad7 100644 --- a/src/views/admin/federation/errors.tpl +++ b/src/views/admin/federation/errors.tpl @@ -11,7 +11,9 @@ {{{ each errors }}}
-
+ + {{{ if (type == "in") }}}IN{{{ else }}}OUT{{{ end }}} +
{./id}