Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

stats ref codes should not be sent at startup #14615

Closed
bbondy opened this issue Jun 30, 2018 · 5 comments
Closed

stats ref codes should not be sent at startup #14615

bbondy opened this issue Jun 30, 2018 · 5 comments

Comments

@bbondy
Copy link
Member

bbondy commented Jun 30, 2018

Test Plan:

  1. Create empty profile folder
  2. Create a file called promoCode in the profile folder with a test promo code, such as kam253
  3. Run Brave with LEDGER_VERBOSE=true and LEDGER_ENVIRONMENT=staging
  4. Confirm promotion code is read after 50 - 70 seconds (you should see call in the terminal)
  5. Make sure that promoCode file is deleted when using real promo code

Description

ledger.js has code for the refcodes to be sent up right away on startup.
We should be avoiding File IO and network requests at startup time in favour of waiting after some initial delay and/or by lazy loading.

In this case, this should instead happen when normal checks happen, see
runtimeUpdateCheckDelay

Steps to Reproduce

  1. Add console.log logging to app/browser/api/ledger.js
    2.Start the browser
  2. Observe output at startup time

Actual result:
Network requests happens at startup

Expected result:
Network request shouldn't happen directly at startup.

Reproduces how often:
Always

Brave Version

0.23.19

about:brave info:

Brave: 0.23.19
V8: 6.7.288.46
rev: 178c3fb
Muon: 7.1.3
OS Release: 17.5.0
Update Channel: Release
OS Architecture: x64
OS Platform: macOS
Node.js: 7.9.0
Tor: 0.3.3.7 (git-035a35178c92da94)
Brave Sync: v1.4.2
libchromiumcontent: 67.0.3396.87

Reproducible on current live release:
Yes

Additional Information

@alexwykoff alexwykoff added release/not-blocking priority/P5 Cosmetic. Spelling, copy, layout. New features (which should also be part of an initiative). priority/P3 Major loss of function. and removed priority/P5 Cosmetic. Spelling, copy, layout. New features (which should also be part of an initiative). labels Jul 3, 2018
ryanml added a commit to ryanml/browser-laptop that referenced this issue Jul 12, 2018
ryanml added a commit to ryanml/browser-laptop that referenced this issue Jul 12, 2018
ryanml added a commit to ryanml/browser-laptop that referenced this issue Jul 15, 2018
ryanml added a commit to ryanml/browser-laptop that referenced this issue Jul 15, 2018
ryanml added a commit to ryanml/browser-laptop that referenced this issue Jul 19, 2018
ryanml added a commit to ryanml/browser-laptop that referenced this issue Jul 19, 2018
@srirambv
Copy link
Collaborator

@ryanml any verification steps required for this? If not please mark it as no-qa-needed

@NejcZdovc
Copy link
Contributor

@srirambv test plan is specified in PR, adding it to this issue as well

@LaurenWags
Copy link
Member

LaurenWags commented Jul 30, 2018

Verified with macOS 10.13 (@kjozwiak ) and 10.12.6 (@LaurenWags) using

  • 0.23.73 50bdb6d
  • Muon 8.0.3
  • libchromiumcontent 68.0.3440.75

Verified on Ubuntu 17.10 x64

  • 0.23.73 50bdb6d
  • Muon 8.0.3
  • libchromiumcontent 68.0.3440.75

@kjozwiak
Copy link
Member

QA wasn't seeing the calls logged within the terminal as per the STR so @ryanml helped debug the issue and created #14874. The promoCode is correctly being removed as expected but the calls are not being logged in the terminal.

@GeetaSarvadnya
Copy link
Collaborator

Verified on Windows x64 with
• 0.23.73 50bdb6d
• Muon 8.0.3
• libchromiumcontent 68.0.3440.75

Verified the promoCode file delete after startup. The above comment mentioned by @kjozwiak is applicable for Windows as well.

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