chore(markdown): add message to copy to markdown #117882
Conversation
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit ad4fce1. Configure here.
| // Mirror Seer: include the event message only when it adds something beyond | ||
| // the title, since for most errors the title already is the message. | ||
| const message = event?.message?.trim(); | ||
| if (message && !group.title.includes(message)) { |
There was a problem hiding this comment.
Bug: The case-sensitive check group.title.includes(message) may fail to detect when the message is already in the title if their casing differs, leading to redundant output.
Severity: LOW
Suggested Fix
Perform a case-insensitive comparison to correctly detect if the message is already in the title. Convert both group.title and message to the same case before the check, for example: group.title.toLowerCase().includes(message.toLowerCase()).
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: static/app/views/issueDetails/hooks/useCopyIssueDetails.tsx#L278
Potential issue: The code uses a case-sensitive `String.prototype.includes()` to check
if an event's `message` is already contained within the `group.title` before adding it
to a generated markdown string. This is intended to prevent duplicating information.
However, if the `message` and its representation in the `title` differ only by case
(e.g., `title` is 'Error: Something failed' and `message` is 'something failed'), the
check will incorrectly return false. This results in the message being redundantly added
to the markdown output.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
doing it this way to match Seer
adds
##Messagesection to the copy to markdown button, based off how seer includes it in the xml (<message>\n{message}\n</message>)Example: