Ensure we only generate a deletion-request ping when toggling from on to off#734
Merged
Merged
Conversation
travis79
approved these changes
Feb 21, 2020
Member
travis79
left a comment
There was a problem hiding this comment.
Increasing test coverage, FTW!
Dexterp37
approved these changes
Feb 21, 2020
Contributor
Dexterp37
left a comment
There was a problem hiding this comment.
LGTM with the nits below addressed
aad11ca to
c75768b
Compare
…to off. The old code already did what we wanted, because when `upload_enabled` is false the ping submission will exit early. This just makes it more explicit, easier to read and understand without that context and we avoid a useless log line.
Under normal use Glean is initialized exactly once. No state is ever reset or reinitialized. Tests however work differently. We need to reset all data. Through configuration we can swap out the used HTTP uploader. Previously however the uploader used by upload workers was created once, lazily. Even if we (test-)reset and change the uploader it wasn't overriden. We can instead make it `lateinit`, thus allowing us to reset it to the value we get from the configuration during `initialize`
c75768b to
b2157fc
Compare
travis79
approved these changes
Feb 21, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The old code already did what we wanted, because when
upload_enabledis false the ping submission will exit early.This just makes it more explicit, easier to read and understand without that context and we avoid a useless log line.