Skip to content

Persist events to disk by default (offline caching) #92

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

Closed
bruno-garcia opened this issue Mar 27, 2021 · 2 comments
Closed

Persist events to disk by default (offline caching) #92

bruno-garcia opened this issue Mar 27, 2021 · 2 comments
Labels
Feature New feature or request Platform: Switch
Milestone

Comments

@bruno-garcia
Copy link
Member

bruno-garcia commented Mar 27, 2021

The .NET SDK offers offline caching through.

Rely on Application.persistentDataPath to get a consistent path. A hash of the DSN should be used to get the path in order to make sure that events don't get mixed up if the DSN changes.

https://docs.sentry.io/platforms/dotnet/configuration/options/#cache-directory-path

We should also add to SentryWindow a way to configure this. How/why needs some thinking but some random thoughts:

  • Opt-out of offline caching
  • Opt-out from blocking app startup in order to flush cached events
    • This should have some big tooltip of sorts describing why it exists. If the app crashes on start, it's the only way to make sure the developer is aware.
  • Change path where the files get cached. (Should this affect the DSN-hash-based prefix?)

The Xamarin SDK uses Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

@bruno-garcia bruno-garcia added the Feature New feature or request label Mar 27, 2021
@bruno-garcia bruno-garcia added this to the 0.2.0 milestone Mar 29, 2021
@bitsandfoxes
Copy link
Contributor

Offline caching has been implemented. But there are some things to note:

  • DSN is not part of the path
  • The path can only be manipulated via code (since Unity provides persistent data path)
  • Does not work on Nintendo Switch and leads to app crash because FileWrite & Application.persistentDataPath seem unsupported

@bruno-garcia
Copy link
Member Author

Offline caching has been implemented. But there are some things to note:

  • DSN is not part of the path

That part is done by the .NET SDK already, we don't need to worry here.

  • The path can only be manipulated via code (since Unity provides persistent data path)

Worth adding a note on the docs but that's OK. Other than potentially related to #290

  • Does not work on Nintendo Switch and leads to app crash because FileWrite & Application.persistentDataPath seem unsupported

True. We need to figure this one out.

The offline support is done though so I'll close this. The Switch issue can be tracked on #290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request Platform: Switch
Projects
None yet
Development

No branches or pull requests

2 participants