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

Reserve tokens #8887

Closed
NejcZdovc opened this issue Mar 27, 2020 · 7 comments · Fixed by brave/brave-core#5552
Closed

Reserve tokens #8887

NejcZdovc opened this issue Mar 27, 2020 · 7 comments · Fixed by brave/brave-core#5552

Comments

@NejcZdovc
Copy link
Contributor

Right now two contribution could use same tokens as we don't marked them as reserved or in progress.

@LaurenWags
Copy link
Member

Labeling QA/Blocked until additional information is obtained on the test plan item Make a one-time contribution and force it to fail all retries from brave/brave-core#5552

@emerick
Copy link
Contributor

emerick commented Aug 5, 2020

@LaurenWags I think the simplest thing to do would be to start the contribution and close the browser and manually update the retry_count to 3 in the contribution_info table. I believe this would simulate the case we're trying to demonstrate.

@LaurenWags
Copy link
Member

Thanks @emerick - I'll give that a try!

@LaurenWags
Copy link
Member

@emerick seems like my tips are going thru too quickly - any suggestions?

@emerick
Copy link
Contributor

emerick commented Aug 5, 2020

@LaurenWags I wonder if going off the network would convince it to retry?

@LaurenWags
Copy link
Member

LaurenWags commented Aug 6, 2020

Verified passed with

Brave | 1.12.108 Chromium: 84.0.4147.105 (Official Build) (64-bit)
-- | --
Revision | a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS | macOS Version 10.14.6 (Build 18G3020)

Verified test plan from brave/brave-core#5552
Confirmed version in meta table is at least 27:
Meta

Confirmed successful 1 time tips have an appropriate reserved_at field value:
successful 1 time tip

To check that reserved_at field is cleared in case of retry failure, I did the following:

  • navigated to a page, opened tip banner, selected a value
  • disabled wifi
  • selected Send tip on the banner
  • closed the browser
  • opened the DB and modified the step in contribution_info to be 4, modified the retry_count in same table to be 3

Screen Shot 2020-08-06 at 11 07 00 AM

  • confirmed no redeemed_at value for the tip in unblinded_tokens but there is a reserved_at value:

Screen Shot 2020-08-06 at 11 00 50 AM

  • saved DB changes
  • re-enabled wifi & relaunched
  • saw [1304:775:0806/110949.478548:INFO:contribution.cc(713)] Contribution failed after 3 retries in my logs
  • confirmed tip not deducted from balance or on brave://rewards page
  • confirmed reserved_at field is cleared on unblinded_tokens

Screen Shot 2020-08-06 at 11 10 43 AM

  • repeated above except used 5 for step value instead of 4

Screen Shot 2020-08-06 at 11 12 49 AM

Screen Shot 2020-08-06 at 11 13 01 AM

  • confirmed reserved_at field was cleared as expected:

Screen Shot 2020-08-06 at 11 15 50 AM

Screen Shot 2020-08-06 at 11 16 05 AM

  • confirmed able to successfully tip after tokens are no longer reserved:

Screen Shot 2020-08-06 at 11 18 06 AM

Screen Shot 2020-08-06 at 11 18 13 AM


Verification passed on

Brave | 1.12.108 Chromium: 84.0.4147.105 (Official Build) (64-bit)
-- | --
Revision | a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS | Windows 10 OS Version 1903 (Build 18362.959)

  • Verified test plan from Add support for reserving tokens brave-core#5552
    image

  • Confirmed successful 1 time tips have an appropriate reserved_at field value:
    image

  • To check that reserved_at field is cleared in case of retry failure,
    image
    image

    • saved DB changes
    • re-enabled wifi & relaunched
    • saw below logs
    • confirmed tip not deducted from balance or on brave://rewards page
    • confirmed reserved_at field is cleared on unblinded_tokens
[6392:15380:0806/231730.419:INFO:contribution.cc(713)] Contribution failed after 3 retries

image

  • repeated above except used 5 for step value instead of 4

image
image

  • confirmed reserved_at field was cleared as expected:
    image

image

  • confirmed able to successfully tip after tokens are no longer reserved:

image
image


Verification passed on

Brave 1.12.108 Chromium: 84.0.4147.105 (Official Build) (64-bit)
Revision a6b12dfad6663f13a7e16e9a42a6a4975374096b-refs/branch-heads/4147@{#943}
OS Ubuntu 18.04 LTS

Verified test plan from brave/brave-core#5552
Confirmed version in meta table is at least 27:
image

Confirmed successful 1 time tips have an appropriate reserved_at field value:
image

To check that reserved_at field is cleared in case of retry failure, I did the following:

  • navigated to a page, opened tip banner, selected a value

  • disabled wifi

  • selected Send tip on the banner

  • closed the browser

  • opened the DB and modified the step in contribution_info to be 4, modified the retry_count in same table to be 3
    image

  • confirmed no redeemed_at value for the tip in unblinded_tokens but there is a reserved_at value:
    image

  • saved DB changes

  • re-enabled wifi & relaunched

  • saw [27535:27535:0807/031431.446265:INFO:contribution.cc(713)] Contribution failed after 3 retries in my logs

  • confirmed tip not deducted from balance or on brave://rewards page

  • confirmed reserved_at field is cleared on unblinded_tokens
    image

  • repeated above except used 5 for step value instead of 4

  • confirmed reserved_at field was cleared as expected

  • confirmed able to successfully tip after tokens are no longer reserved

@emerick emerick added OS/Android Fixes related to Android browser functionality OS/Desktop OS/iOS Fixes related to iOS browser functionality labels Aug 7, 2020
@srirambv
Copy link
Contributor

Verification passed on OnePlus 6T with Android 10 running 1.12.112 x64 build

  • Verified that database is migrated and version is above v27
    image
  • Verified reserved_at defaults to 0 in migrated unblinded_tokens table
    image
  • Verified for a successful one-time tip reserved_at and redeemed_at is set correctly
    image

Make a one-time contribution and verify that tip gets an appropriate reserved_at timestamp

  • navigated to a page, opened tip banner, selected a value
    • disabled wifi
    • selected Send tip on the banner
    • closed the browser
    • opened the DB and modified the step in contribution_info to be 4, modified the retry_count in same table to be 3
      image
  • confirmed no redeemed_at value for the tip in unblinded_tokens but there is a reserved_at value:
    image
  • saved DB changes
    • re-enabled wifi & relaunched
    • saw [1304:775:0806/110949.478548:INFO:contribution.cc(713)] Contribution failed after 3 retries in my logs
      image
    • confirmed tip not deducted from balance or on brave://rewards page
    • confirmed reserved_at field is cleared on unblinded_tokens
      image

Verified making a one-time contribution and force it to fail all retries, reserved_at field is cleared

  • navigated to a page, opened tip banner, selected a value
    • disabled wifi
    • selected Send tip on the banner
    • closed the browser
    • opened the DB and modified the step in contribution_info to be 5, modified the retry_count in same table to be 3
      image
  • confirmed no redeemed_at value for the tip in unblinded_tokens but there is a reserved_at value:
    image
  • saved DB changes
    • re-enabled wifi & relaunched
    • saw [1304:775:0806/110949.478548:INFO:contribution.cc(713)] Contribution failed after 3 retries in my logs
      image
    • confirmed tip not deducted from balance or on brave://rewards page
    • confirmed reserved_at field is cleared on unblinded_tokens
      image

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