-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Description
In #16657 we got some user feedback that our consoleLoggingIntegration was sending logs with [Object Object] and [Array]. This was because of how we serialize with the safeJoin utility, since it uses String(value).
sentry-javascript/packages/core/src/utils/string.ts
Lines 68 to 94 in b94f652
| export function safeJoin(input: unknown[], delimiter?: string): string { | |
| if (!Array.isArray(input)) { | |
| return ''; | |
| } | |
| const output = []; | |
| // eslint-disable-next-line @typescript-eslint/prefer-for-of | |
| for (let i = 0; i < input.length; i++) { | |
| const value = input[i]; | |
| try { | |
| // This is a hack to fix a Vue3-specific bug that causes an infinite loop of | |
| // console warnings. This happens when a Vue template is rendered with | |
| // an undeclared variable, which we try to stringify, ultimately causing | |
| // Vue to issue another warning which repeats indefinitely. | |
| // see: https://github.com/getsentry/sentry-javascript/pull/8981 | |
| if (isVueViewModel(value)) { | |
| output.push('[VueViewModel]'); | |
| } else { | |
| output.push(String(value)); | |
| } | |
| } catch (e) { | |
| output.push('[value cannot be serialized]'); | |
| } | |
| } | |
| return output.join(delimiter); | |
| } |
| output.push(String(value)); |
This was fixed in #16658 by removing the usage of the safeJoin utility.
We should re-evaluate safeJoin usage across the SDKs and see if we want to replace it with JSON.stringify(normalize) instead.
Metadata
Metadata
Assignees
Labels
No labels