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

If client database says promotion is OVER but server says it is not, then set the promotion to ACTIVE #14741

Closed
Miyayes opened this issue Mar 15, 2021 · 2 comments · Fixed by brave/brave-core#8268

Comments

@Miyayes
Copy link
Collaborator

Miyayes commented Mar 15, 2021

Description

Implement a fix such that if the client DB says that a promotion is OVER, but the server says it not, then set the promotion back to ACTIVE.

This will improve resilience and clear up some cases users are experiencing.

cc: @evq @zenparsing

@stephendonner
Copy link

Verified PASSED using the testplan from brave/brave-core#8268 with nightly build

Brave 1.24.35 Chromium: 90.0.4430.41 (Official Build) nightly (x86_64)
Revision e9c92b1eaca8487e212f3f6bc081fdb6d4863759-refs/branch-heads/4430@{#723}
OS macOS Version 11.2.3 (Build 20D91)

Steps:

  1. Started the browser with a clean profile pointed to staging: --args --enable-logging=stderr --vmodule="*/bat-native-ledger/*"=6,"*/brave_rewards/*"=6,"*/bat-native-ads/*"=6,"*/bat-native-confirmations/*"=6,"*/brave_ads/*"=6,"*/brave_user_model/*"=6 --brave-ads-staging --brave-ads-debug --rewards=staging=true,reconcile_interval=5,persist-logs=true
  2. Clicked the Rewards icon to initialize rewards and download a UGP promotion (but did not yet claim it).
  3. Closed the browser.
  4. Opened the rewards database in DB Browser for SQLite and viewed the contents of the promotions table. Found the promotion record corresponding to the UGP and set the status field to 5; clicked Write changes then Close database.
publisher_info_db, claim status 0 publisher_info_db, claim status 5
Screen Shot 2021-03-30 at 1 54 30 PM Screen Shot 2021-03-30 at 2 04 06 PM

I also removed "promotion_last_fetch_stamp":"1617137167", from Preferences in Default so the server would re-issue the promotional grant.

  1. Started the browser.
  2. Navigated to brave://rewards.
  3. Verifed that the UGP promotion can be claimed.
UGP grant available UGP grant claimed brave://rewards
Screen Shot 2021-03-30 at 2 15 27 PM Screen Shot 2021-03-30 at 2 15 56 PM Screen Shot 2021-03-30 at 2 16 07 PM

@stephendonner stephendonner added QA Pass-macOS and removed QA/In-Progress Indicates that QA is currently in progress for that particular issue labels Mar 30, 2021
@kjozwiak kjozwiak removed the OS/Android Fixes related to Android browser functionality label May 10, 2021
@kjozwiak
Copy link
Member

kjozwiak commented May 10, 2021

Removing OS/Android as we don't have the ability to edit the Preferences file or update the rewards database. We do have the ability to export/import the database, but can't edit the Preference file so I don't think there's a way that we can get the server to re-issue the UGP grant on Android. @Miyayes @zenparsing @SergeyZhukovsky please let me know if anyone has any objections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment