From 30068245d3a854a3a5554d81b25b12738d201c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 28 Feb 2025 11:10:31 -0500 Subject: [PATCH 1/3] fix: don't crash if there are exceptions in action hooks since some action hooks are called without an await --- src/plugins/hooks.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/hooks.js b/src/plugins/hooks.js index 8a5d1a885d..553e90db45 100644 --- a/src/plugins/hooks.js +++ b/src/plugins/hooks.js @@ -275,8 +275,12 @@ async function fireActionHook(hook, hookList, params) { winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`); } } else { - // eslint-disable-next-line - await hookObj.method(params); + try { + // eslint-disable-next-line + await hookObj.method(params); + } catch (err) { + winston.error(`[plugins] Error in hook ${hookObj.id}@${hookObj.hook} \n${err.stack}`); + } } } } From 1d4be4752c413aab0d37e4bcaa21a15c82ff1311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 28 Feb 2025 14:35:02 -0500 Subject: [PATCH 2/3] chore: up markdown --- install/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/package.json b/install/package.json index ab1ada6165..cf70babd8d 100644 --- a/install/package.json +++ b/install/package.json @@ -103,7 +103,7 @@ "nodebb-plugin-dbsearch": "6.2.13", "nodebb-plugin-emoji": "6.0.2", "nodebb-plugin-emoji-android": "4.1.1", - "nodebb-plugin-markdown": "13.1.0", + "nodebb-plugin-markdown": "13.1.1", "nodebb-plugin-mentions": "4.7.0", "nodebb-plugin-spam-be-gone": "2.3.1", "nodebb-plugin-web-push": "0.7.3", From 8dbd50d452649f82525398b21cb6a98070073a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 28 Feb 2025 14:37:03 -0500 Subject: [PATCH 3/3] fix: closes #13219, only delete local user folder --- src/user/delete.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/user/delete.js b/src/user/delete.js index 9329e5150a..a4aac56c9f 100644 --- a/src/user/delete.js +++ b/src/user/delete.js @@ -234,7 +234,9 @@ module.exports = function (User) { } async function deleteImages(uid) { - const folder = path.join(nconf.get('upload_path'), 'profile', `uid-${uid}`); - await rimraf(folder); + if (utils.isNumber(uid)) { + const folder = path.join(nconf.get('upload_path'), 'profile', `uid-${uid}`); + await rimraf(folder); + } } };