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

Confirmations state could be reset due to race condition when saving/loading state #3532

Closed
tmancey opened this issue Feb 28, 2019 · 1 comment · Fixed by brave/brave-core#1809

Comments

@tmancey
Copy link
Contributor

tmancey commented Feb 28, 2019

Description

Confirmations state could be reset due to race condition when saving/loading state

Steps to Reproduce

  1. View an Ad
  2. Close the browser
  3. Launch the browser

Actual result:

Defaults/rewards_service/confirmations.json state could be reset to defaults

Expected result:

Defaults/rewards_service/confirmations.json state should retained previous state

Reproduces how often:

Intermittent issue

Brave version (brave://version info)

0.63.x

Reproducible on current release:

  • Does it reproduce on brave-browser dev/beta builds? No

Website problems only:

  • Does the issue resolve itself when disabling Brave Shields? N/A
  • Is the issue reproducible on the latest version of Chrome? N/A

Additional Information

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Apr 10, 2019

Verification passed on

Brave 0.63.35 Chromium: 74.0.3729.61 (Official Build) beta (64-bit)
Revision 5df2c8936783bd7575987e45d72a92fcf528496b-refs/branch-heads/3729@{#645}
OS Windows 10 OS Build 17134.523
  • Verified the test plan from Resolved Confirmations state could be reset due to race condition when saving/loading state brave-core#1809

  • After getting 1st AD disconnected and reconnected the n/w and verified that confirm state has not reset to default
    Default - confirmations.json
    "next_token_redemption_date_in_seconds": "13199971578",
    "transaction_history": {
    "transactions": []
    },

    1st AD - confirmations.json
    "next_token_redemption_date_in_seconds": "13199971578",
    "transaction_history": {
    "transactions": [
    {
    "confirmation_type": "view",
    "estimated_redemption_value": 0.05,
    "timestamp_in_seconds": "13199366906"
    },
    {
    "confirmation_type": "click",
    "estimated_redemption_value": 0,
    "timestamp_in_seconds": "13199366909"
    },
    {
    "confirmation_type": "landed",
    "estimated_redemption_value": 0,
    "timestamp_in_seconds": "13199366919"
    }
    ]
    },
    2nd AD confirmations.json
    "next_token_redemption_date_in_seconds": "13199971578",
    "transaction_history": {
    "transactions": [
    {
    "confirmation_type": "view",
    "estimated_redemption_value": 0.05,
    "timestamp_in_seconds": "13199366906"
    },
    {
    "confirmation_type": "click",
    "estimated_redemption_value": 0,
    "timestamp_in_seconds": "13199366909"
    },
    {
    "confirmation_type": "landed",
    "estimated_redemption_value": 0,
    "timestamp_in_seconds": "13199366919"
    },
    {
    "confirmation_type": "view",
    "estimated_redemption_value": 0.05,
    "timestamp_in_seconds": "13199368502"
    },
    {
    "confirmation_type": "click",
    "estimated_redemption_value": 0,
    "timestamp_in_seconds": "13199368508"
    },
    {
    "confirmation_type": "landed",
    "estimated_redemption_value": 0,
    "timestamp_in_seconds": "13199368518"
    }
    ]
    },

Verification passed on both

Brave 0.63.40 Chromium: 74.0.3729.61 (Official Build) beta(64-bit)
Revision 5df2c8936783bd7575987e45d72a92fcf528496b-refs/branch-heads/3729@{#645}
OS Linux
Brave 0.64.47 Chromium: 74.0.3729.61 (Official Build) dev(64-bit)
Revision 5df2c8936783bd7575987e45d72a92fcf528496b-refs/branch-heads/3729@{#645}
OS Linux
  • Verified the test plan multiple times by closing the browser immeidately after viewing an ad/clicking an ad/dismissing an ad and there was no issues with confirmation.json file

Verified passed with

Brave 0.63.44 Chromium: 74.0.3729.75 (Official Build) beta(64-bit)
Revision fdb7915642fef8cf997beac2554709d148e3c187-refs/branch-heads/3729@{#754}
OS Mac OS X

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