-
Notifications
You must be signed in to change notification settings - Fork 4.7k
fix(html-reporter): prevent crash when annotation type is missing or non-string #37761
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
fix(html-reporter): prevent crash when annotation type is missing or non-string #37761
Conversation
@microsoft-github-policy-service agree |
This comment has been minimized.
This comment has been minimized.
2059116
to
4165f16
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
09cc292
to
8393d85
Compare
This comment has been minimized.
This comment has been minimized.
5edd4f0
to
e9b5ebe
Compare
This comment has been minimized.
This comment has been minimized.
e9b5ebe
to
38b3ba0
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With a project of this size, we require that users file an issue so we can triage it before evaluating any PRs.
6b1df0f
to
e04b44f
Compare
This comment has been minimized.
This comment has been minimized.
here you go, please #37771 |
This comment has been minimized.
This comment has been minimized.
…merable properties
eb75da7
to
27b0222
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I unknowingly copied a buggy pattern that was introduced in Jun 2023 f55bfe2#diff-9fe1fe455371e5592c4ac04ef88de1ae4331ce749bd6333afe8734bb4f7d8b4e for attachments.push. It was latent, because no tests were comparing the attachments arr with toEqual(). When I applied the same pattern to annotations.push, I triggered the bug because the test DOES compare the annotations arr. Fixed both. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I’ve reverted that change in this PR - I’ll open a separate issue explaining why the og pattern is buggy and share the link here /w you once it’s ready. |
This comment has been minimized.
This comment has been minimized.
|
|
||
let description = annotation.description; | ||
if (description !== undefined && description !== null && typeof description !== 'string') | ||
description = JSON.stringify(description); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#37761 (comment)
I think, for non-string descriptions
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Test results for "MCP"2550 passed, 102 skipped Merge workflow run. |
Test results for "tests 1"2 flaky45628 passed, 811 skipped Merge workflow run. |
Sorry folks, I'm closing this due to no issue and / or repro steps. I know it is frustrating, but it must start with the issue. |
@pavelfeldman the issue is here: #37771 I even created it on req: #37761 (comment) |
@vladlearns Sorry, there was a misunderstanding here! |
PR should start with the issue, this is now addressed, so we can proceed. Looking at it again, a couple of thoughts:
With that I'm inclined to close the PR. |
yeah, this is a much better approach. Let's use zod. I will close this one. |
ref: #37959 |
Fixes #37771.
Defensive change to make sure that if a.type is undefined or any falsy val, it defaults to an empty string before calling .toLowerCase(), preventing the crash
Crash happens here:

