From b17b3befdf860eeb532d9dfd78903ab15a709b2f Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Fri, 27 Sep 2024 14:11:21 -0600 Subject: [PATCH 1/2] fix: Avoid notifying `watch.settings` on uncaught errors (#33376) --- .../server/lib/RocketChat.ErrorHandler.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts b/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts index 264443a1378b..984561fe13cd 100644 --- a/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts +++ b/apps/meteor/app/error-handler/server/lib/RocketChat.ErrorHandler.ts @@ -3,14 +3,13 @@ import { Meteor } from 'meteor/meteor'; import { throttledCounter } from '../../../../lib/utils/throttledCounter'; import { sendMessage } from '../../../lib/server/functions/sendMessage'; -import { notifyOnSettingChanged } from '../../../lib/server/lib/notifyListener'; import { settings } from '../../../settings/server'; const incException = throttledCounter((counter) => { Settings.incrementValueById('Uncaught_Exceptions_Count', counter, { returnDocument: 'after' }) .then(({ value }) => { if (value) { - void notifyOnSettingChanged(value); + settings.set(value); } }) .catch(console.error); @@ -118,5 +117,12 @@ process.on('unhandledRejection', (error) => { process.on('uncaughtException', async (error) => { incException(); + + console.error('=== UnCaughtException ==='); + console.error(error); + console.error('-------------------------'); + console.error('Errors like this can cause oplog processing errors.'); + console.error('==========================='); + void errorHandler.trackError(error.message, error.stack); }); From a430faf72bb160355bf7cb92549e27d341e35d7c Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 27 Sep 2024 18:52:13 -0300 Subject: [PATCH 2/2] chore: add gazzodown preview (#33279) --- .gitignore | 2 ++ packages/gazzodown/.storybook/main.js | 8 ++++++++ packages/gazzodown/package.json | 2 ++ 3 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 03e74631957b..8ca2d018f92e 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,5 @@ storybook-static data/ registration.yaml + +storybook-static diff --git a/packages/gazzodown/.storybook/main.js b/packages/gazzodown/.storybook/main.js index de5a951bbded..f12b58cf856f 100644 --- a/packages/gazzodown/.storybook/main.js +++ b/packages/gazzodown/.storybook/main.js @@ -15,6 +15,14 @@ module.exports = { include: /node_modules/, loader: 'babel-loader', }); + config.module.rules.push({ + test: /\.m?js$/, + include: /node_modules/, + type: 'javascript/auto', + use: { + loader: require.resolve('babel-loader'), + }, + }); return config; }, }; diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index cf4a9209d649..ca64df5ec913 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -10,6 +10,8 @@ "scripts": { "build": "rm -rf dist && tsc -p tsconfig.build.json", "build-storybook": "build-storybook", + "build-preview": "build-storybook --quiet", + ".:build-preview-move": "mkdir -p ../../.preview && cp -r ./storybook-static ../../.preview/gazzodown", "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput", "lint": "eslint --ext .js,.jsx,.ts,.tsx .", "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix",