Open krystofwoldrich opened 1 year ago
Shouldn't it be named Sentry.crashedLastRunEventId
?
Sentry.lastEvendId
is too generic. I could assume that it returns the last send event ID or the last captured event ID.
Sentry.lastEvendId
is too generic. I could assume that it returns the last send event ID or the last captured event ID.
It returns the last captured event id.
The last captured event will likely be the one that caused the crash.
You can already get the event id of the last captured event, as capture...
returns the event id. You can use that for attachments and user feedback.
The last captured event will likely be the one that caused the crash.
How can Sentry.lastEvendId
guarantee to return the event id of the last crash? What if you immediately capture an event after launching your application? On Android, the SDK may send the event before the OS terminates the crashing app, so we would need to store the event id to disk.
For adding an attachment to the crash event, the event id wouldn't help, as you can't send attachments only with the event id. You can only add them to an event, as far as I know. For that use case, we can use hints.
I agree with Philipp, we should probably introduce a new crashedLastRunEventId
, because lastEventId
might be overwritten by some other event, but the users of the SDK have not asked their users about feedback yet, then the lastEventId
would point to the incorrect event. @krystofwoldrich thoughts?
@philipphofmann @romtsn I agree the Sentry.crashedLastRunEventId
is a better option, as there can not be any confusion about what is it id for.
Hi, Do you have an update on this feature for react-native ? I don't find crashedLastRunEventId anywhere? cheers !
@ludwig-pro Thank you for your interest, as mentioned in sentry-react-native, we haven't implemented this yet.
We already have in the mobile SDKs
Sentry.crashedLastRun
, but if users would like to createuserFeedback
orattachment
for the event causing the crash, they can't at the moment becauseSentry.lastEventId
returns undefined on the app relaunch. Therefore, we add a new property,Sentry.crashedLastRunEventId
, which returns the event id of the last crash if the app crashed on a previous run ornull
if there was no crash on a previous run.