Skip to content

chore(markdown): add message to copy to markdown #117882

Merged
shayna-ch merged 1 commit into
masterfrom
shayna-ch/add-message-to-markdown
Jun 16, 2026
Merged

chore(markdown): add message to copy to markdown #117882
shayna-ch merged 1 commit into
masterfrom
shayna-ch/add-message-to-markdown

Conversation

@shayna-ch

Copy link
Copy Markdown
Member

adds ##Message section to the copy to markdown button, based off how seer includes it in the xml (<message>\n{message}\n</message>)

Example:

##Message 

Unrecognized Slack API message. Api Message: The request to the Slack API failed.

@shayna-ch

Copy link
Copy Markdown
Member Author

bugbot run

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 16, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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.

@shayna-ch shayna-ch marked this pull request as ready for review June 16, 2026 22:32
@shayna-ch shayna-ch requested a review from a team as a code owner June 16, 2026 22:32
@shayna-ch shayna-ch requested a review from a team June 16, 2026 22:32
// 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)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doing it this way to match Seer

@shayna-ch shayna-ch merged commit 8f7bed5 into master Jun 16, 2026
72 checks passed
@shayna-ch shayna-ch deleted the shayna-ch/add-message-to-markdown branch June 16, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants