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
Change the accessor for InstallationId from internal to public. That way the Unity SDK can overwrite the lazy initialization during options construction. (Hacky)
Add controls over writing to disk. That could be a new option. Or we reuse CacheDirectoryPath. With the CacheDirectoryPath set to null we skip all operations writing to disk. We've already got FileSystem in place.
We could replace all instances of the SDK directly calling Directory.Create for File.Write going through FileSystem and make that adhere to the options.
The text was updated successfully, but these errors were encountered:
Going with solution 2. It's been like that for some time so there's no need to hack something together. Let's introduce a new options i.e. DisableFileWrite and route all writing to disk through our FileSystem.
Todo: Make sure reading from disk actually works on those restricted platforms.
Problem
Writing to disk on restricted platforms - i.e. Nintento Switch - causes the game to crash: getsentry/sentry-unity#1804
What's happening
We're fetching the
installationId
lazilysentry-dotnet/src/Sentry/SentryOptions.cs
Line 1184 in 9ad2caa
and during event enrichment that
installationId
gets resolvedsentry-dotnet/src/Sentry/Internal/Enricher.cs
Line 83 in 9ad2caa
and this causes the InstallationIdHelper to attempt to create a persistent
installationId
on disksentry-dotnet/src/Sentry/Internal/InstallationIdHelper.cs
Lines 30 to 33 in 9ad2caa
sentry-dotnet/src/Sentry/Internal/InstallationIdHelper.cs
Lines 48 to 56 in 9ad2caa
Solutions
Change the accessor for(Hacky)InstallationId
frominternal
topublic
. That way the Unity SDK can overwrite the lazy initialization during options construction.sentry-dotnet/src/Sentry/SentryOptions.cs
Line 45 in 9ad2caa
CacheDirectoryPath
. With theCacheDirectoryPath
set tonull
we skip all operations writing to disk. We've already gotFileSystem
in place.sentry-dotnet/src/Sentry/Internal/FileSystem.cs
Line 19 in 9ad2caa
We could replace all instances of the SDK directly calling
Directory.Create
forFile.Write
going throughFileSystem
and make that adhere to the options.The text was updated successfully, but these errors were encountered: