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

Record storagemanager cache behaviour in internal error reports #588

Merged
merged 7 commits into from
Sep 25, 2019

Conversation

fractalwrench
Copy link
Contributor

Goal

Android API 26 introduced setCacheBehaviorGroup, which tells the OS to delete all the files in a given directory if space needs reclaiming. Coupled with setCacheBehaviorTombstone which truncates files to 0, this could explain the volume of minimal error reports reported by some customers.

We should record this information in our internal error diagnostics to debug the issue further.

Tests

Tested against a local artefact on API 23 + 29 which had been altered to always call recordStorageCacheBehavior when notifying.

@fractalwrench
Copy link
Contributor Author

I've updated the PR to get the tombstone behaviour directly from the bugsnag-errors directory rather than context.cacheDir.

Copy link
Contributor

@tomlongridge tomlongridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some automated tests to check the fields are set in the internal error report?

@fractalwrench
Copy link
Contributor Author

I've updated the mazerunner scenario for an internal error report to check the storagemanager cache values are set, and to more generally validate other fields that we add to BugsnagDiagnostics.

Copy link
Contributor

@kattrali kattrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left comments on one scenario, though the commentary (mostly) applies to both.

tests/features/internal_report.feature Outdated Show resolved Hide resolved
tests/features/internal_report.feature Outdated Show resolved Hide resolved
tests/features/internal_report.feature Outdated Show resolved Hide resolved
@fractalwrench fractalwrench force-pushed the record-cache-behavior branch 2 times, most recently from 9ad18fb to 05f2b42 Compare September 24, 2019 16:18
@fractalwrench fractalwrench dismissed kattrali’s stale review September 25, 2019 09:11

addressed review points

@fractalwrench
Copy link
Contributor Author

I have updated the internal_report feature to run 3 scenarios:

  • One for verifying reports are sent on API <26
  • One for verifying cache tombstone/group behaviour is false by default
  • One for verifying cache tombstone/group behaviour is true when enabled

I have also updated the assertion steps as requested.

@fractalwrench fractalwrench merged commit 5568c8b into master Sep 25, 2019
@fractalwrench fractalwrench deleted the record-cache-behavior branch September 25, 2019 10:06
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