Skip to content

Commit e5b4c27

Browse files
committed
chore: wip test sentry recursion fix
1 parent 71e8f1b commit e5b4c27

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/domain/app/sentry/utils.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ const SENTRY_DENYLIST = [
7171
'zipcode',
7272
];
7373

74-
export const cleanSensitiveData = (data: Record<string, unknown>) => {
75-
console.log('Cleaning sensitive data:', JSON.stringify(data));
74+
export const cleanSensitiveData = (
75+
data: Record<string, unknown>,
76+
seen: WeakSet<object> = new WeakSet()
77+
) => {
7678
Object.entries(data).forEach(([key, value]) => {
79+
if (seen.has(data)) {
80+
return data;
81+
}
82+
seen.add(data);
83+
7784
console.log(`Processing key: ${key}, value:`, JSON.stringify(value));
7885
if (
7986
SENTRY_DENYLIST.includes(key) ||

0 commit comments

Comments
 (0)