You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Auto Session Tracking should only be enabled by default on Mobile until total process isolation is supported #264
The session support currently expects exclusive access to the directory it caches data. This works well in sandboxed apps like on mobile but not on Desktop when multiple instances can be executed concurrently.
For this reason, until getsentry/sentry-dotnet#1067 is fixed, we can only opt-in to auto session tracking safely if we are sure there's only 1 instance of the app (mobile, or a player on desktop that only allows one instance running).
When PlayerSettings.forceSingleInstance is set we're safe to enable auto session tracking. Also if the player is Android or iOS and console.
PlayerSettings.forceSingleInstance is present in UnityEditor.dll and not available in Sentry.Unity (references UnityEngine) where logic for this is executing (SentryOptionsUtility.SetDefaults).
Suggested way is to use Platform dependent compilation approach. But the problem is still in PlayerSettings.forceSingleInstance not available at the place of calling.
Possible implementation could look something like this
SentryWindow runs in the editor (Sentry.Unity.Editor), we could read PlayerSettings.forceSingleInstance there and set it to the scriptable object and rely on that value at runtime to disable auto session tracking if the Application.platform is standalone and forceSingleInstance is not true.
Activity
semuserable commentedon Jul 30, 2021
PlayerSettings.forceSingleInstanceis present inUnityEditor.dlland not available inSentry.Unity(referencesUnityEngine) where logic for this is executing (SentryOptionsUtility.SetDefaults).There are 2 possible approaches to determine the platform: Application.platform or Platform dependent compilation.
Suggested way is to use
Platform dependent compilationapproach. But the problem is still inPlayerSettings.forceSingleInstancenot available at the place of calling.Possible implementation could look something like this
bruno-garcia commentedon Aug 3, 2021
SentryWindowruns in the editor (Sentry.Unity.Editor), we could readPlayerSettings.forceSingleInstancethere and set it to the scriptable object and rely on that value at runtime to disable auto session tracking if theApplication.platformis standalone andforceSingleInstanceis not true.Or we live with this until we address getsentry/sentry-dotnet#1067
bitsandfoxes commentedon Sep 16, 2021
The
SentryWindowwould not get notified about a change to the player settings. But we could read them during pre-build and set it accordingly?vaind commentedon Mar 11, 2022
As per a discord discussion:
fix: add a workaround for #264 - don't run multiple sessions at the s…
3 remaining items
vaind commentedon Mar 21, 2022
Updating impact, priority & status after the workaround has been implemented. The final solution is blocked by the dotnet issue.
fix: add a workaround for #264 - don't run multiple sessions at the s…
Don't run sentry-dotnet with multiple app instances at the same time …