Skip to content
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

Add persistenceDirectory config option for controlling event/session storage #998

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Nov 12, 2020

Goal

Adds a persistenceDirectory config option that controls where events/sessions are stored. By default this remains context.cacheDir. This gets us one step closer to supporting Clients in multiple processes.

Changeset

  • Added persistenceDirectory option to Configuration that allows users to set a custom File
  • Updated FileStore constructor to take a File that specifies the directory where reports should be persisted. If it is not possible to write to the directory an error is logged
  • Refactored existing storage code to use greater use of File rather than String for calculating paths
  • Updated NativeInterface.getReportPath() to use config.persistenceDirectory when calculating storage directory

Testing

  • Added unit tests to assert that persistenceDirectory can have its values set on the public API as expected
  • Assert that persistenceDirectory is set to the context.cacheDir by default
  • Refactor Event/SessionStoreMaxLimitTest to be unit tests, as FileStore no longer requires a Context and can therefore run on the JVM (this is much faster)
  • Updated tests to use a custom persistenceDirectory and Files rather than Strings where necessary

@fractalwrench fractalwrench changed the title feat: add persistenceDirectory config option Add persistenceDirectory config option for controlling event/session storage Nov 12, 2020
@fractalwrench fractalwrench force-pushed the PLAT-5399/persistence-directory branch from 09e417f to ac3e0e0 Compare November 12, 2020 15:45
@bugsnagbot
Copy link
Collaborator

bugsnagbot commented Nov 12, 2020

Android notifier sizes

Format Size impact of Bugsnag (kB) Size impact of Bugsnag when Minified (kB)
APK 1442.05 1361.31
arm64_v8a 369.25 287.32
armeabi 348.77 266.85
armeabi_v7a 332.39 250.47
x86 410.2 328.27
x86_64 389.73 307.81

Generated by 🚫 Danger

@fractalwrench fractalwrench force-pushed the PLAT-5399/persistence-directory branch 3 times, most recently from 5f55f37 to 003a976 Compare November 13, 2020 17:09
@fractalwrench fractalwrench marked this pull request as ready for review November 13, 2020 18:03
@fractalwrench fractalwrench force-pushed the PLAT-5399/persistence-directory branch from 7425920 to 3e4f0fa Compare November 17, 2020 16:06
@fractalwrench fractalwrench force-pushed the PLAT-5399/persistence-directory branch from 3e4f0fa to 87eb4a5 Compare November 17, 2020 16:20
@fractalwrench fractalwrench merged commit f2a4f33 into integration/road-958-multi-process Nov 18, 2020
@fractalwrench fractalwrench deleted the PLAT-5399/persistence-directory branch November 18, 2020 09:31
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.

3 participants