From aef840c2ccc73090bff5dc66aaedf7890df60bca Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Sat, 25 Feb 2023 10:15:25 +0100 Subject: [PATCH] Bugfix/fix maximum call stack size exceeded error in value redaction (#1743) * Bugfix for RangeError: Maximum call stack size exceeded * Update changelog --- CHANGELOG.md | 1 + apps/api/src/helper/object.helper.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 087480e8d..b2c0912f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed `RangeError: Maximum call stack size exceeded` for values of type `Big` in the value redaction interceptor for the impersonation mode - Reset the letter spacing in buttons ## 1.237.0 - 2023-02-19 diff --git a/apps/api/src/helper/object.helper.ts b/apps/api/src/helper/object.helper.ts index 7ee07b468..6db53b0a1 100644 --- a/apps/api/src/helper/object.helper.ts +++ b/apps/api/src/helper/object.helper.ts @@ -1,3 +1,4 @@ +import Big from 'big.js'; import { cloneDeep, isArray, isObject } from 'lodash'; export function hasNotDefinedValuesInObject(aObject: Object): boolean { @@ -59,7 +60,10 @@ export function redactAttributes({ return redactAttributes({ options, object: currentObject }); } ); - } else if (isObject(redactedObject[property])) { + } else if ( + isObject(redactedObject[property]) && + !(redactedObject[property] instanceof Big) + ) { // Recursively call the function on the nested object redactedObject[property] = redactAttributes({ options,