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
feat: Add screenshot at crash #1920
Conversation
|
…sentry-cocoa into feat/crash-screenshot
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.
The approach makes sense to me. Good job 💯. We still miss tests.
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
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.
Nice, another pass.
…sentry-cocoa into feat/crash-screenshot
…sentry-cocoa into feat/crash-screenshot
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.
Almost LGTM, thanks great job 👏 .
uint32_t lowerBaseID = (uint32_t)(baseID & 0xffffffff); | ||
g_nextUniqueIDLow = lowerBaseID; |
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.
m
: Why this change?
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.
This I don't get it. But without the change it does not work and g_nextUniqueIDLow is always the same.
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.
I just debugged it and it wasn't for me. That would be weird.
|
||
if (report[SENTRYCRASH_REPORT_SCREENSHOT_ITEM]) { | ||
for (NSString *ssPath in report[SENTRYCRASH_REPORT_SCREENSHOT_ITEM]) { | ||
[scope addAttachment:[[SentryAttachment alloc] initWithPath:ssPath]]; |
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.
h
: When do we delete the screenshots? The attachments will be read when the SDK creates the envelope. How do we know that the screenshots are still stored on disk? Maybe it's better to read the attachments already here, and use SentryAttachment .initWithData
. Then we could delete them already here.
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.
Screenshots are deleted alongside the report. We had a code for that already.
Lets say we fail to transmit the report, on the next attempt the files won't be there, I rather have the current mechanism that deletes it.
@brustolin, I think you should ping someone from the native team or maybe Andrew to get a review on the C code, please. |
Co-authored-by: Philipp Hofmann <philipp.hofmann@sentry.io>
…sentry-cocoa into feat/crash-screenshot
Hey @Swatinem and @armcknight. I had to wrote a little bit of C here, can you review that? Thanks!! |
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.
Just one h
comment to address and a review from native to merge this PR.
uint32_t lowerBaseID = (uint32_t)(baseID & 0xffffffff); | ||
g_nextUniqueIDLow = lowerBaseID; |
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.
I just debugged it and it wasn't for me. That would be weird.
Nice! Congtats! |
* master: build: Remove trailing-whitespace (#1953) ci: Compile iOS13-Swift sample (#1951) release: 7.20.0 meta: Fix changelog (#1950) feat: Add sample rate in the baggage header, remove Userid and Transaction (#1936) build: Upate Brewfile.lock and Gemfile.lock (#1947) meta: Add Pre Commit Hook (#1946) ref: Remove unused SentryCrashDeadlock (#1941) feat: Add screenshot at crash (#1920) Add code docs for SentryScope (#1942)
Was forgotten to add in GH-1920.
Was forgotten to add in GH-1920.
📜 Description
Try to add a screenshot during a hard crash
💡 Motivation and Context
Close #1873
💚 How did you test it?
Unit tests
📝 Checklist
🔮 Next steps