Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Telemetry] Bug in trackException() where data is undefined #14184

Closed
danielayala94 opened this issue Dec 9, 2024 · 1 comment · Fixed by #14191
Closed

[Telemetry] Bug in trackException() where data is undefined #14184

danielayala94 opened this issue Dec 9, 2024 · 1 comment · Fixed by #14191
Assignees
Labels
Area: Telemetry bug Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot)

Comments

@danielayala94
Copy link
Contributor

Problem Description

In #14146, trackException() throws an exception as data is undefined, in reference to this part of the function:

// Copy miscellaneous system error fields into the codedError.data object
    const syscallExceptionFieldsToCopy = ['errno', 'syscall', 'code'];
    for (const f of syscallExceptionFieldsToCopy) {
      if ((error as any)[f]) {
        codedErrorStruct.data.codedError.data[f] = (error as any)[f]; // This throws the exception.
      }
    }

Steps To Reproduce

Needs to introduce a unit test, initially looking for codedError.data to be {} (see codedErrorStruct definition).

Expected Results

trackException() should not throw.

CLI version

15.0.1

Environment

See #14146

Community Modules

No response

Target Platform Version

None

Target Device(s)

No response

Visual Studio Version

None

Build Configuration

None

Snack, code example, screenshot, or link to a repository

No response

@danielayala94 danielayala94 self-assigned this Dec 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Dec 9, 2024
@danielayala94 danielayala94 changed the title [Telemetry] Potential bug in trackException() where data is undefined [Telemetry] Bug in trackException() where data is undefined Dec 9, 2024
@danielayala94
Copy link
Contributor Author

danielayala94 commented Dec 9, 2024

Reproduced the issue after running the command in the cloned project from the dev who reported #14146.

Seems like to trigger this issue, it needs an exception that is not of type errorUtils.codedError, so codedError.data is empty and any of the syscallExceptionFieldsToCopy is present in the error parameter.

@danielayala94 danielayala94 removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Dec 9, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot) label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Telemetry bug Invalid Triage https://github.com/microsoft/react-native-windows/wiki/Triage-Process (label applied by bot)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant