Skip to content

Node.js based forum software built for the modern web

fix: wrong database key

Julian Lam818d621de34e
diff --git a/public/language/en-GB/admin/settings/activitypub.json b/public/language/en-GB/admin/settings/activitypub.json
index 272e9b4363..c86caee393 100644
--- a/public/language/en-GB/admin/settings/activitypub.json
+++ b/public/language/en-GB/admin/settings/activitypub.json
@@ -77,5 +77,6 @@
"analytics.hourly": "Hourly",
"analytics.daily": "Daily",
- "errors.intro": "The following errors were recorded by this instance within the last 24 hours."
+ "errors.intro": "The following errors were recorded by this instance within the last 24 hours.",
+ "errors.payload-gone": "The payload for this error no longer exists."
}
\ No newline at end of file
diff --git a/src/controllers/admin/federation.js b/src/controllers/admin/federation.js
index 537d27799b..7dad353ab2 100644
--- a/src/controllers/admin/federation.js
+++ b/src/controllers/admin/federation.js
@@ -87,8 +87,8 @@ federationController.analytics = async function (req, res) {
};
federationController.errors = async function (req, res) {
- const ids = await db.getSortedSetRangeByScore('ap:errors', 0, -1, '-inf', Date.now());
- const payloads = await db.mget(ids.map(id => `ap:errors:${id}`));
+ const ids = await db.getSortedSetRangeByScore('ap.errors', 0, -1, '-inf', Date.now());
+ const payloads = await db.mget(ids.map(id => `ap.errors:${id}`));
const errors = ids.map((id, idx) => {
return { id, payload: payloads[idx] };
});
diff --git a/src/views/admin/federation/errors.tpl b/src/views/admin/federation/errors.tpl
index 1364f5cf19..d0f738c776 100644
--- a/src/views/admin/federation/errors.tpl
+++ b/src/views/admin/federation/errors.tpl
@@ -8,7 +8,11 @@
{{{ each errors }}}
<details>
<summary>{./id}</summary>
+ {{{ if ./payload }}}
<pre class="m-2 border p-2"><code>{./payload}</code></pre>
+ {{{ else }}}
+ <em>[[admin/settings/activitypub:errors.payload-gone]]</em>
+ {{{ end }}}
</details>
{{{ end }}}
</div>