Skip to content

Re-evaluate safeJoin usage and align console integration behaviour across SDKs #16664

@AbhiPrasad

Description

@AbhiPrasad

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).

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

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions