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

Referral finalization isn't being recorded properly #2011

Closed
emerick opened this issue Nov 6, 2018 · 3 comments · Fixed by brave/brave-core#819
Closed

Referral finalization isn't being recorded properly #2011

emerick opened this issue Nov 6, 2018 · 3 comments · Fixed by brave/brave-core#819

Comments

@emerick
Copy link
Contributor

emerick commented Nov 6, 2018

Description

When we check for referral finalization, we're failing to parse the server response. This results in the client continuing to check for finalization even if it was successful.

Steps to Reproduce

  1. Run a Brave referral installer
  2. Once the promoCode file is deleted from the profile directory, close Brave
  3. Set the environment variable BRAVE_REFERRALS_CHECK_TIME to 5 (units are in seconds)
  4. Launch Brave with this value set
  5. Wait 30 seconds, just to be sure
  6. Close Brave to ensure preferences are updated on disk

Actual result:

The following message is written to the log file:

Failed to parse referral finalization check response

Expected result:

Either:

  • The referral is finalized, in which case no error message is written to the log
  • The referral is not finalized, in which case the following error message is written to the log Referral is not ready, please wait at least 30 days and the Local State file in the profile directory will contain values that show that Brave is still making attempts to finalize the referral (e.g., "referral_attempt_count":1,"referral_attempt_timestamp":"13186003104101127")

Since referrals aren't finalized until 30 days after initialization, it can be difficult to test the first scenario above. In that particular scenario, you must contact someone on our referrals team and give them the particular download_id that you're testing. They will be able to configure the referrals server to send a positive response for that download_id.

Reproduces how often:

Always

@GeetaSarvadnya
Copy link

GeetaSarvadnya commented Nov 7, 2018

@emerick I have launched brave using env flag BRAVE_REFERRALS_CHECK_TIME=5 BraveSoftware/Brave-Browser/Application/brave.exe got an console error message saying Referral is not ready, please wait at least 30 days ( Expected result 2).
If, I launch brave using env flag BRAVE_REFERRALS_CHECK_TIME=5000 BraveSoftware/Brave-Browser/Application/brave.exe I did not see any console error (Expected result 1).

Should it be seconds or milliseconds? Please clarify.

@emerick
Copy link
Contributor Author

emerick commented Nov 7, 2018

@GeetaSarvadnya BRAVE_REFERRAL_CHECK_TIME and BRAVE_REFERRAL_DELETE_TIME are both in seconds. I updated the STR to mention the units.

@kjozwiak
Copy link
Member

This was basically tested under #287 and #1842. Labelling as QA/No.

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