-
Notifications
You must be signed in to change notification settings - Fork 68
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.properties.result reflects "Failed" even if the operation was canceled and UserCancledError was thrown #1306
Comments
Thanks for reporting the issue. We have also configured Webpack to not mangle function names as you have done in your fix. Without configuring Webpack properly, I'm not sure how to fix this. |
I am a little nit confused here. You are not exporting minified code, are you ? I am looking inside the node_modules/@microsoft/vscode-azext-utils folder and its all JS files. Well, as for a fix, why not use instanceof operator ? :) |
We are not exporting minified code.
Unfortunately, |
I think if there is a limitation, then we will stick to the webpack configuration. You may close the issue now :) |
Were you able to fix this issue by altering your webpack config? |
Yes. Here's the webpack changes that we made: optimization: {
minimize: true,
/**
* **DO NOT REMOVE**
* Workaround for https://github.com/Azure/ms-rest-nodeauth/issues/83
*/
minimizer: [
new TerserPlugin({
terserOptions: {
keep_fnames: /AbortSignal|UserCancelledError/,
keep_classnames: /AbortSignal|UserCancelledError/
}
})
]
}, |
I had thought we'd placed a property on UserCancelledError to avoid this issue:
Then clients can simply check for the existence of this property and name mangling won't matter. |
It doesn't look like we ever did that. And I agree we should do that so runtime behavior isn't impacted by bundling configuration. |
It might be overkill for the use case, but we may also benefit from having another method like this, that checks the function isUserCancelledError(foo: unknown): foo is UserCancelledError {
// ...
} |
Here is one of our sample telemetry event being captured in Kusto:
It is clear that the operation was canceled from the error message and the
laststep
property but theresult
property says "Failed" instead of "Canceled"My best guess is that its because of this piece of code here
utils\src\parseError.ts at parseError() function
A constructor.name comparison has been relied upon to check whether its a UserCanceledError or not. This doesn't work with webpack as the constructor names are minified.
The text was updated successfully, but these errors were encountered: