Skip to content

Conversation

@thomaszurkan-optimizely
Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely commented Jul 11, 2019

Summary

  • If the cached datafile is removed or corrupted, and last modified has already been set, the app won't load.
  • If loading synchronously there is a similar problem where the datafile cache exists but is corrupt, it will also fail to initialize.

Issues

@thomaszurkan-optimizely thomaszurkan-optimizely changed the title Corrupt datafile cache fix (fix): Corrupt datafile cache fix Jul 11, 2019
Copy link
Contributor

@mikeproeng37 mikeproeng37 left a comment

Choose a reason for hiding this comment

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

lgtm

if (!datafileCache.exists() || (datafileCache.exists() && datafileCache.load() == null)) {
// create a wrapper for application context default storage.
OptlyStorage storage = new OptlyStorage(this.datafileService.getApplicationContext());
// set the last modified for this url to 1 millisecond passed Jan 1, 1970.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I think it's "past" and not "passed"

@thomaszurkan-optimizely thomaszurkan-optimizely merged commit a7265a7 into master Jul 11, 2019
@mikeproeng37 mikeproeng37 deleted the corruptDatafileCacheFix branch July 12, 2019 18:33
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