Skip to content

Ensure we only generate a deletion-request ping when toggling from on to off#734

Merged
badboy merged 3 commits into
masterfrom
no-more-multiple-deletion-request-ping
Feb 21, 2020
Merged

Ensure we only generate a deletion-request ping when toggling from on to off#734
badboy merged 3 commits into
masterfrom
no-more-multiple-deletion-request-ping

Conversation

@badboy
Copy link
Copy Markdown
Member

@badboy badboy commented Feb 21, 2020

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.

@badboy badboy requested a review from Dexterp37 February 21, 2020 12:40
@auto-assign auto-assign Bot requested a review from travis79 February 21, 2020 12:40
Copy link
Copy Markdown
Member

@travis79 travis79 left a comment

Choose a reason for hiding this comment

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

Increasing test coverage, FTW!

Copy link
Copy Markdown
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

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

LGTM with the nits below addressed

Comment thread glean-core/src/lib.rs Outdated
Comment thread glean-core/tests/ping.rs
@badboy badboy force-pushed the no-more-multiple-deletion-request-ping branch 2 times, most recently from aad11ca to c75768b Compare February 21, 2020 14:48
@badboy badboy requested review from Dexterp37 and travis79 February 21, 2020 14:48
…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`
@badboy badboy force-pushed the no-more-multiple-deletion-request-ping branch from c75768b to b2157fc Compare February 21, 2020 14:49
Copy link
Copy Markdown
Contributor

@Dexterp37 Dexterp37 left a comment

Choose a reason for hiding this comment

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

Good catch!

@badboy badboy merged commit ef37b8d into master Feb 21, 2020
@badboy badboy deleted the no-more-multiple-deletion-request-ping branch February 21, 2020 16:01
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