Skip to content

fix: change sync-init flow to support project auto update on cache download #318

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

Merged
merged 7 commits into from
Mar 13, 2020

Conversation

jaeopt
Copy link
Contributor

@jaeopt jaeopt commented Feb 20, 2020

Summary

  • Synchronous init has one more config parameter (updateConfigOnNewDatafile).
  • When it's set true, the project config is automatically updated when an updated datafile is downloaded for caching. Otherwise, the cached datafile is used when the SDK is started next time (default).

Issues

  • OASIS-5957

Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely 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 remove the listener from enableUpdateConfigOnNewDatafile?

}

public void enableUpdateConfigOnNewDatafile(Context context, DatafileConfig datafileConfig, DatafileLoadedListener listener) {
if (listener != null) {
Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely Mar 10, 2020

Choose a reason for hiding this comment

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

i don't think the listener should exist here. i think it can be removed. thoughts?

if you are going to store the listener as property, you need to clear it out along with the file observer when stop is called (after line 186). Because, once it is set you don't allow it to be reset. thanks!

Copy link
Contributor

@thomaszurkan-optimizely thomaszurkan-optimizely left a comment

Choose a reason for hiding this comment

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

LGTM

@jaeopt jaeopt merged commit 3db0560 into master Mar 13, 2020
@jaeopt jaeopt deleted the jae/init-sync-flow branch March 13, 2020 18:28
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.

2 participants