From 9eea12ec5609e9330bba44aa97768ea0ef8932e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Wed, 11 Mar 2026 20:35:38 -0400 Subject: [PATCH 1/6] fix: cache key --- src/groups/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groups/index.js b/src/groups/index.js index e4f24e5335..1e50814a79 100644 --- a/src/groups/index.js +++ b/src/groups/index.js @@ -120,7 +120,7 @@ Groups.getAllGroupNames = async function (set) { return [...names]; } names = await db.getSortedSetRevRange(set, 0, -1); - cache.set(names); + cache.set(cacheKey, names); return [...names]; }; From a3ee74478f9b0c08012ee80d8e7bc3d0c6dd5744 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 12 Mar 2026 11:36:06 -0400 Subject: [PATCH 2/6] fix: skip AP cache on context processing methods --- src/activitypub/contexts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/activitypub/contexts.js b/src/activitypub/contexts.js index 8335ae7cc4..fa4709158a 100644 --- a/src/activitypub/contexts.js +++ b/src/activitypub/contexts.js @@ -25,7 +25,7 @@ Contexts.get = async (uid, id) => { } try { - ({ id, type, context } = await activitypub.get('uid', uid, id, { headers })); + ({ id, type, context } = await activitypub.get('uid', uid, id, { headers, cache: false })); if (activitypub._constants.acceptable.contextTypes.has(type)) { // is context activitypub.helpers.log(`[activitypub/context] ${id} is the context.`); return { context: id }; @@ -35,7 +35,7 @@ Contexts.get = async (uid, id) => { } // context provided; try to resolve it. - ({ type } = await activitypub.get('uid', uid, context)); + ({ type } = await activitypub.get('uid', uid, context, { cache: false })); } catch (e) { if (e.code === 'ap_get_304') { activitypub.helpers.log(`[activitypub/context] ${id} context unchanged.`); @@ -65,7 +65,7 @@ Contexts.getItems = async (uid, id, options) => { } else { activitypub.helpers.log(`[activitypub/context] Retrieving context/page ${id}`); try { - object = await activitypub.get('uid', uid, id); + object = await activitypub.get('uid', uid, id, { cache: false }); } catch (e) { return false; } From 59dd22ca2e8bb00dd8ec57ab4d96af5347cb4f23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 12 Mar 2026 22:04:48 -0400 Subject: [PATCH 3/6] fix: type --- src/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/notifications.js b/src/notifications.js index fd0d01ce55..ef7e813a95 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -549,7 +549,7 @@ Notifications.merge = async function (notifications) { const type = typeFromLength(usernames); const isMultiple = type === 'multiple'; const txArgs = [ - `${mergeId}-${type}`, + `${mergeId}${type ? `-${type}` : ''}`, ...usernames.slice(0, usernames.length <= 3 ? 3 : 2), ...(isMultiple ? [usernames.length - 2] : []), notifObj.roomIcon, @@ -570,7 +570,7 @@ Notifications.merge = async function (notifications) { const type = typeFromLength(usernames); const isMultiple = type === 'multiple'; const txArgs = [ - `${mergeId}-${type}`, + `${mergeId}${type ? `-${type}` : ''}`, ...usernames.slice(0, usernames.length <= 3 ? 3 : 2), ...(isMultiple ? [usernames.length - 2] : []), utils.decodeHTMLEntities(notifObj.topicTitle || ''), From 4d55ee0a55d95ecc5e41339d4f5c64550c08e4af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 12 Mar 2026 22:13:38 -0400 Subject: [PATCH 4/6] perf: move out nconf.get and isClientScript regex --- src/controllers/404.js | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/controllers/404.js b/src/controllers/404.js index bed1a085e3..03407e084c 100644 --- a/src/controllers/404.js +++ b/src/controllers/404.js @@ -9,12 +9,17 @@ const plugins = require('../plugins'); const activitypub = require('../activitypub'); const middleware = require('../middleware'); const helpers = require('../middleware/helpers'); -const { secureRandom } = require('../utils'); + +const relativePath = nconf.get('relative_path'); +const isClientScript = new RegExp(`^${relativePath}\\/assets\\/src\\/.+\\.js(\\?v=\\w+)?$`); + +const error404Icons = [ + 'fa-hippo', 'fa-cat', 'fa-otter', + 'fa-dog', 'fa-cow', 'fa-fish', + 'fa-dragon', 'fa-horse', 'fa-dove', +]; exports.handle404 = helpers.try(async (req, res) => { - const relativePath = nconf.get('relative_path'); - const isClientScript = new RegExp(`^${relativePath}\\/assets\\/src\\/.+\\.js(\\?v=\\w+)?$`); - if (plugins.hooks.hasListeners('action:meta.override404')) { return plugins.hooks.fire('action:meta.override404', { req: req, @@ -62,16 +67,12 @@ exports.send404 = helpers.try(async (req, res) => { bodyClass: helpers.buildBodyClass(req, res), }); } - const icons = [ - 'fa-hippo', 'fa-cat', 'fa-otter', - 'fa-dog', 'fa-cow', 'fa-fish', - 'fa-dragon', 'fa-horse', 'fa-dove', - ]; + await middleware.buildHeaderAsync(req, res); res.render('404', { path: validator.escape(path), title: '[[global:404.title]]', bodyClass: helpers.buildBodyClass(req, res), - icon: icons[secureRandom(0, icons.length - 1)], + icon: error404Icons[Math.floor(Math.random() * error404Icons.length)], }); }); From 26bb60effcc485cd72eaa55088486ff9b280d11d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 12 Mar 2026 22:02:03 -0400 Subject: [PATCH 5/6] fix: merged chat notifications if all the messages are from the same user usernames.length ends up being 1 so need to use default translation string and not -dual/-triple/-multiple variants --- src/notifications.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/notifications.js b/src/notifications.js index ef7e813a95..197ea656cc 100644 --- a/src/notifications.js +++ b/src/notifications.js @@ -515,7 +515,9 @@ Notifications.merge = async function (notifications) { differentiators.forEach((differentiator) => { function typeFromLength(items) { - if (items.length === 2) { + if (items.length <= 1) { + return ''; + } else if (items.length === 2) { return 'dual'; } else if (items.length === 3) { return 'triple'; From 73b023b430d8dcf5aaa92647286009e100f89315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 17 Mar 2026 10:42:35 -0400 Subject: [PATCH 6/6] chore: up composer --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index 4a9cfa33a8..3fad170317 100644 --- a/install/package.json +++ b/install/package.json @@ -97,7 +97,7 @@ "multer": "2.1.1", "nconf": "0.13.0", "nodebb-plugin-2factor": "7.6.1", - "nodebb-plugin-composer-default": "10.3.27", + "nodebb-plugin-composer-default": "10.3.28", "nodebb-plugin-dbsearch": "6.4.1", "nodebb-plugin-emoji": "6.0.6", "nodebb-plugin-emoji-android": "4.1.1",