Skip to content

feat(attachments): Include all attachment with screenshot in name #91602

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

Merged
merged 4 commits into from
May 15, 2025

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented May 13, 2025

Currently, attachments considered as screenshots are very restrictive. This opens it up to any files containing screenshot in their name.

This will be immediately useful to Native attachments, which name the files as crash_screenshot.png.

Fixes #91430.

…n name

Currently, attachments considered as screenshot is very restrictive. This opens it up to any files containing `screenshot` in their name.

This will be immediately useful to Native attachments which name the files as `crash_screenshot.png`.

Fixes #91430.
@armenzg armenzg self-assigned this May 13, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 13, 2025
assert len(response.data) == 1
assert response.data[0]["id"] == str(attachment1.id)

def test_second_screenshot_filter(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need this second test anymore.

)
self.create_attachment(file_name="screenshot.png", event_id=group1_event.event_id)
self.create_attachment(file_name="screenshot-1.png", event_id=group1_event.event_id)
self.create_attachment(file_name="foo.png", event_id=group1_event.event_id)
Copy link
Member Author

Choose a reason for hiding this comment

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

This attachment will not be included.

Copy link
Member

Choose a reason for hiding this comment

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

cool, how about a comment?

)
self.create_attachment(file_name="screenshot.png", event_id=group1_event.event_id)
self.create_attachment(file_name="screenshot-1.png", event_id=group1_event.event_id)
self.create_attachment(file_name="foo.png", event_id=group1_event.event_id)
Copy link
Member

Choose a reason for hiding this comment

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

cool, how about a comment?

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

We should update the develop docs accordingly - https://develop.sentry.dev/sdk/expected-features/#screenshots

might also make sense for us to link to the develop docs in src/sentry/models/eventattachment.py.

armenzg added a commit to getsentry/sentry-docs that referenced this pull request May 15, 2025
@armenzg armenzg merged commit 138af3b into master May 15, 2025
59 checks passed
@armenzg armenzg deleted the fix/attachments/armenzg branch May 15, 2025 14:24
armenzg added a commit to getsentry/sentry-docs that referenced this pull request May 15, 2025
@vaind
Copy link
Contributor

vaind commented May 16, 2025

Does this change mean that the any jpg/png attachment with string "screenshot" in the name also shows up as a screenshot in the issue? Doesn't do that here: https://sentry-sdks.sentry.io/issues/6588764536/events/abe3bb91767749b09d61a0978ad9a21c/

@armenzg
Copy link
Member Author

armenzg commented May 16, 2025

Does this change mean that the any jpg/png attachment with string "screenshot" in the name also shows up as a screenshot in the issue? Doesn't do that here: https://sentry-sdks.sentry.io/issues/6588764536/events/abe3bb91767749b09d61a0978ad9a21c/

Your issue [1] does not seem to have the clipboard and the Screenshots section [2].

[1]
image

[2]
image

In the Attachments section, you can see your screenshots:
image

Another place that the screenshots will show up under is View all attachments [1] -> Screenshots [2]

[1]
image

[2]
image

@github-actions github-actions bot locked and limited conversation to collaborators Jun 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convention used to define attachment in screenshot is strict and not obvious
4 participants