Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Fix booster notification background trigger (EXPOSUREAPP-11804) #4838

Conversation

LukasLechnerDev
Copy link
Contributor

This PR fixes the issue that the booster notifications are not triggered by our background worker.

Because of a copy-paste mistake of mine (in WorkerBinder.kt), the background worker did actually never run...

How to test:

  • Fresh install
  • Start app
  • Switch to WRU and set "fake correct device time" in Remote Config Data Test Menu (Not sure if this switch is really necessary to set
  • Close app
  • Set device time to 2022-02-10 12:30
  • Open App
  • Force ccl config update (config from WRU and INT are different)
  • Scan certificate from the ticket
  • See that booster notification shows up
  • Close app and click on notification
  • Close app
  • Set device time 24h into the future (2022-02-11 12:30)
  • Without opening the app, the worker should start its work and the booster notificaiton should appear

@LukasLechnerDev LukasLechnerDev added bug Something isn't working maintainers Tag pull requests created by maintainers labels Feb 15, 2022
@LukasLechnerDev LukasLechnerDev added this to the 2.18.0 milestone Feb 15, 2022
@LukasLechnerDev LukasLechnerDev requested a review from a team February 15, 2022 11:23
return PeriodicWorkRequestBuilder<CCLConfigurationUpdateWorker>(
repeatInterval = 24,
repeatIntervalTimeUnit = TimeUnit.HOURS
).setConstraints(constraints).build()
).setInitialDelay(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related to the bug, but I added a 1 minute delay for the worker so that the app and the worker won't both update the config after app start at the same time.

@@ -48,14 +47,13 @@ class CCLConfigurationUpdateScheduler @Inject constructor(
}

private fun buildWorkRequest(): PeriodicWorkRequest {
val constraints = Constraints.Builder()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We shouldn't only run the worker when we have network connection, since the dccwallet recalculation should run daily even if we can't get the config from the network.

Copy link
Contributor

@mtwalli mtwalli left a comment

Choose a reason for hiding this comment

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

LGTM

@mtwalli mtwalli self-assigned this Feb 15, 2022
@jurajkusnier jurajkusnier self-assigned this Feb 15, 2022
@sonarcloud
Copy link

sonarcloud bot commented Feb 15, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@jurajkusnier jurajkusnier left a comment

Choose a reason for hiding this comment

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

LGTM

@jurajkusnier jurajkusnier merged commit 761a437 into release/2.18.x Feb 15, 2022
@jurajkusnier jurajkusnier deleted the fix/11804-fix-booster-notification-background-trigger branch February 15, 2022 14:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working maintainers Tag pull requests created by maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants