-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix(trace): don't replace unknown braces in action title #36920
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(trace): don't replace unknown braces in action title #36920
Conversation
| title.push(chunk); | ||
|
|
||
| const param = formatProtocolParam(action.params, quotedText); | ||
| if (!param) { |
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.
Let's make formatProtocolParam return undefined for failures, so we can differentiate between an empty string and a missing param.
We should also update renderTitleForCall.
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.
Done. I also had to change the title in protocol.yml to remove our "{a}{b}" syntax of optionality, since it's clashing with this change.
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.
This comment has been minimized.
This comment has been minimized.
packages/protocol/src/protocol.yml
Outdated
|
|
||
| clockFastForward: | ||
| title: Fast forward clock "{ticksNumber}{ticksString}" | ||
| title: Fast forward clock "{ticks}" |
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.
How about {ticksNumber|ticksString}?
| if (param === undefined) { | ||
| elements.push(fullMatch); | ||
| title.push(fullMatch); | ||
| currentIndex = match.index + fullMatch.length; |
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.
nit: I'd prefer this line to not be repeated, perhaps if () {} else if () {} else {} would be better?
| return params[name]; | ||
| return urlObject.pathname + urlObject.search; | ||
| } catch (error) { | ||
| return params[name]; |
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.
| return params[name]; | |
| if (params[name] !== undefined) | |
| return params[name]; |
| if (name === 'timeNumber') { | ||
| // eslint-disable-next-line no-restricted-globals | ||
| return new Date(params[name]).toString(); | ||
| return new Date(params[name]).toString(); |
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.
| return new Date(params[name]).toString(); | |
| if (params[name] !== undefined) | |
| return new Date(params[name]).toString(); |
Test results for "tests 1"1 failed 7 flaky46578 passed, 806 skipped Merge workflow run. |
Closes #36483