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

Guard claim promotion from the UI #9662

Closed
NejcZdovc opened this issue May 6, 2020 · 3 comments · Fixed by brave/brave-core#5485
Closed

Guard claim promotion from the UI #9662

NejcZdovc opened this issue May 6, 2020 · 3 comments · Fixed by brave/brave-core#5485

Comments

@NejcZdovc
Copy link
Contributor

Right now if UI for some reason doesn't clear the claim button user could click on it twice which could override privacy pass data from the first click. To prevent this we should put guard in place in function Promotion::Claim (which is called from the UI, so that we check if promotion is already in progress we should exit so that we don't override any data. Retry logic will take over if something goes wrong

@GeetaSarvadnya
Copy link

@NejcZdovc brave/brave-core#5485 - we cannot execute step 4 (solve captcha) and step 5 (make sure that you see an error and status stays at 1). After changing promotion status to 1, relaunch browser and click on BAT logo shows the claim button (so we don't have clear captcha modal). Click on claim just clears the promotion from UI. step 4 and 5 are expected? or it's bug.

@NejcZdovc
Copy link
Contributor Author

@GeetaSarvadnya do not restart browser, change value in db while browser is still running

@srirambv
Copy link
Contributor

srirambv commented Jun 2, 2020

Verification passed on

Brave 1.10.81 Chromium: 81.0.4044.138 (Official Build) beta (64-bit)
Revision 8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{# 999}
OS Windows 10 OS Version 1809 (Build 17763.379)

Screenshot 2020-06-02 at 11 52 32 a m

Verification passed on

Brave 1.10.80 Chromium: 81.0.4044.138 (Official Build) dev (64-bit)
Revision 8c6c7ba89cc9453625af54f11fd83179e23450fa-refs/branch-heads/4044@{#999}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#5485

  • Verified promotion showed error when trying to claim
    image
  • Verified the promotion is cleared
  • Verified status of the promotion did not change

Verification PASSED on macOS 10.15.5 x64 using the following build:

Brave | 1.10.86 Chromium: 83.0.4103.61 (Official Build) (64-bit)
-- | --
Revision | 94f915a8d7c408b09cc7352161ad592299f384d2-refs/branch-heads/4103@{#561}
OS | macOS Version 10.15.5 (Build 19F101)
  • Verified the case outlined via Promotion guards brave-core#5485 without issues
  • ensured that the promotion was cleared once OK was clicked on the Oops, something is wrong. Please try again later. error.
  • ensured that the status not any unexpected values where changed under the promotion table via publisher_info_db

Screen Shot 2020-06-08 at 3 33 48 PM

Screen Shot 2020-06-08 at 3 34 08 PM

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

Successfully merging a pull request may close this issue.

6 participants