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

Refactoring load/unload of Cliqz modules, fix for GH-476. #8

Merged
merged 4 commits into from Mar 19, 2018

Conversation

@zarembsky
Copy link
Contributor

@zarembsky zarembsky commented Mar 16, 2018

  • [ x] Have you followed the guidelines in CONTRIBUTING.md?
  • [ x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • [ x] Have you added an explanation of what your changes do?
  • [ x] Does your submission pass tests?
  • [x ] Did you lint your code prior to submission?
@zarembsky zarembsky requested review from jsignanini and ghostery/ghostery as code owners Mar 16, 2018
@zarembsky zarembsky requested a review from trickpattyFH20 Mar 16, 2018
if (err !== true) {
log('HUMANWEB ERROR:', err, conf.enable_anti_tracking);
}
});

This comment has been minimized.

@jsignanini

jsignanini Mar 19, 2018
Member

Can we make these error checkings a bit more intuitive? Right now it's saying "if error was untrue, then there was an error", which is obviously a contradiction.

}
return module.isReady().then(() => cliqz.disableModule(module.name));
log('MODULE IS ALREADY IN CORRECT STATE', module, enabled);
return Promise.resolve(CORRECT_STATE);

This comment has been minimized.

@jsignanini

jsignanini Mar 19, 2018
Member

Let's add a few checks here to make sure the module parameter actually is indeed a fully qualified module object. Otherwise make the function fail gracefully.

Serge Zarembsky added 2 commits Mar 19, 2018
Serge Zarembsky
Serge Zarembsky
@@ -87,7 +87,8 @@ function setCliqzModuleEnabled(module, enabled) {
return cliqz.enableModule(module.name);
} else if (!enabled && module.isEnabled) {
log('SET CLIQZ MODULE DISABLED', module);
return module.isReady().then(() => cliqz.disableModule(module.name));
cliqz.disableModule(module.name);
return Promise.resolve();

This comment has been minimized.

@jsignanini

jsignanini Mar 19, 2018
Member

Should this instead be return Promise.resolve(CORRECT_STATE);? @zarembsky

Copy link
Member

@jsignanini jsignanini left a comment

Looks good, thanks!

@jsignanini jsignanini merged commit d848377 into ghostery:develop Mar 19, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants