Content-Length: 290793 | pFad | http://github.com/getsentry/sentry-javascript/issues/16664

7E Re-evaluate `safeJoin` usage and align console integration behaviour across SDKs · Issue #16664 · getsentry/sentry-javascript · GitHub
Skip to content

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

Open
@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 labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/getsentry/sentry-javascript/issues/16664

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy