Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

Resolves #1721

What this does

Sessions can now be ended as Unhandled and this PR is the Unity specific followup of getsentry/sentry-dotnet#4653

The logging integrations have to mark exceptions as Mechanism.Terminal = false; for this to work.

Result

First run

  1. Game launches
  2. Experiences an unhandled exception
  3. Shuts down gracefully (at a later time)

Sentry: (Debug) Attempting to recover persisted session from file. 
Sentry: (Debug) No cached file to process. 
Sentry: (Debug) Checking for 'CrashedLastRun' 
Sentry: (Debug) Native SDK reported: 'crashedLastRun': 'False' 
Sentry: (Info) Recovered session: EndStatus: Exited. PauseTimestamp: 10/29/2025 3:25:50 PM +00:00. PendingUnhandled: False 

Sentry: (Info) Started new session (SID: 680ce4133f744b7cb8c1f6a662e11dbe; DID: 490e1b75-b17e-41c3-8a3f-7cc0a02e6ac9). 
Sentry: (Debug) Persisting session (SID: '680ce4133f744b7cb8c1f6a662e11dbe') to a file. 
Sentry: (Debug) Creating persistence directory for session file at '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A'. 
Sentry: (Debug) Persisted session to a file '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A/.session'. 

Sentry: (Info) Capturing event. 

Sentry: (Debug) Marking session as 'Unhandled', due to non-terminal unhandled exception. 
Sentry: (Debug) Persisting session (SID: '680ce4133f744b7cb8c1f6a662e11dbe') to a file. 
Sentry: (Debug) Creating persistence directory for session file at '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A'. 
Sentry: (Debug) Persisted session to a file '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A/.session'. 

Sentry: (Info) Quitting. Pausing session and flushing. 
Sentry: (Info) Pausing session (SID: 680ce4133f744b7cb8c1f6a662e11dbe; DID: 490e1b75-b17e-41c3-8a3f-7cc0a02e6ac9). 
Sentry: (Debug) Persisting session (SID: '680ce4133f744b7cb8c1f6a662e11dbe') to a file. 
Sentry: (Debug) Creating persistence directory for session file at '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A'. 
Sentry: (Debug) Persisted session to a file '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A/.session'. 

Second run

  1. Game launches
  2. Updates session from first run as Unhandled
  3. Experiences exception - marks as unhandled again
  4. Crashes
 
Sentry: (Debug) Attempting to recover persisted session from file. 
Sentry: (Debug) Checking for 'CrashedLastRun' 
Sentry: (Debug) Native SDK reported: 'crashedLastRun': 'False' 
Sentry: (Info) Recovered session: EndStatus: Unhandled. PauseTimestamp: 10/29/2025 3:25:57 PM +00:00. PendingUnhandled: True 

Sentry: (Info) Started new session (SID: 0f8a8ec6ca7241c89ce759e26b43f580; DID: 490e1b75-b17e-41c3-8a3f-7cc0a02e6ac9). 
Sentry: (Debug) Persisting session (SID: '0f8a8ec6ca7241c89ce759e26b43f580') to a file. 
Sentry: (Debug) Creating persistence directory for session file at '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A'. 
Sentry: (Debug) Persisted session to a file '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A/.session'. 

Sentry: (Info) Capturing event. 

Sentry: (Debug) Marking session as 'Unhandled', due to non-terminal unhandled exception. 
Sentry: (Debug) Persisting session (SID: '0f8a8ec6ca7241c89ce759e26b43f580') to a file. 
Sentry: (Debug) Creating persistence directory for session file at '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A'. 
Sentry: (Debug) Persisted session to a file '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A/.session'. 

CRASH

Third run

  1. Launches
  2. Updates session from first run as Crashes

Sentry: (Debug) Attempting to recover persisted session from file. 
Sentry: (Debug) Checking for 'CrashedLastRun' 
Sentry: (Debug) Native SDK reported: 'crashedLastRun': 'True' 
Sentry: (Info) Recovered session: EndStatus: Crashed. PauseTimestamp: . PendingUnhandled: True 

Sentry: (Info) Started new session (SID: 052a99311ac64cde97b54ce076cabccc; DID: 490e1b75-b17e-41c3-8a3f-7cc0a02e6ac9). 
Sentry: (Debug) Persisting session (SID: '052a99311ac64cde97b54ce076cabccc') to a file. 
Sentry: (Debug) Creating persistence directory for session file at '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A'. 
Sentry: (Debug) Persisted session to a file '/Users/bitfox/Library/Application Support/com.DefaultCompany.unity-of-bugs/Sentry/40AD943C7A638EFBE52F9ECCCAF93C031D408E8A/.session'. 

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 29, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against f415568

@bitsandfoxes bitsandfoxes merged commit 70a7c7f into feat/bump-version6 Oct 30, 2025
16 checks passed
@bitsandfoxes bitsandfoxes deleted the feat/unhandled-session branch October 30, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants