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

Roundtrip calls from the ledgerApi should include clientOptions #14874

Closed
ryanml opened this issue Jul 31, 2018 · 1 comment
Closed

Roundtrip calls from the ledgerApi should include clientOptions #14874

ryanml opened this issue Jul 31, 2018 · 1 comment

Comments

@ryanml
Copy link
Contributor

ryanml commented Jul 31, 2018

Test Plan

  1. Create empty profile folder
  2. Create a file called promoCode in the profile folder with the KAM253 promo
  3. Run Brave with LEDGER_VERBOSE=true

After about 20-30 seconds, you should see the following output (originally it wasn't dumping any information into the terminal):

<<< PUT https://laptop-updates.brave.com/promo/initialize/nonua
<<< content-type: application/json; charset=utf-8
<<< user-agent: Brave/0.23.80 Chrome/68.0.3440.84 Muon/8.0.8 macOS x64
<<< accept-encoding:
<<<
<<< {
<<<   "api_key": "fe033168-0ff8-4af6-9a7f-95e2cbfc9f4f",
<<<   "referral_code": "KAM253",
<<<   "platform": "osx"
<<< }
[ response for PUT https://laptop-updates.brave.com/promo/initialize/nonua ]
>>> HTTP/1.1 200
>>> accept-ranges: bytes
>>> cache-control: no-cache, no-store, must-revalidate, private, max-age=0
>>> connection: keep-alive
>>> content-length: 79
>>> content-type: application/json; charset=utf-8
>>> date: Tue, 14 Aug 2018 20:13:16 GMT
>>> expires: 0
>>> pragma: no-cache
>>> server: Cowboy
>>> via: 1.1 vegur
>>> x-cache: MISS
>>> x-cache-hits: 0
>>> x-served-by: cache-yyz8333-YYZ
>>> x-timer: S1534277597.503382,VS0,VE243
>>>
>>> {"download_id":"0a443e56-4034-4703-9674-1b678a2e00c3","referral_code":"KAM253"}

Original Issue

This was something that @kjozwiak and I noticed during a working session. clientOptions such as verboseP are not passed in any of the roundtrip calls in ledger.js, (Just is {}) see:

https://github.com/brave/browser-laptop/blob/master/app/browser/api/ledger.js#L2109
https://github.com/brave/browser-laptop/blob/master/app/browser/api/ledger.js#L2181
https://github.com/brave/browser-laptop/blob/master/app/browser/api/ledger.js#L3105

The bat-client sends all of the current clientOptions in each round trip call, so there is some missed networking debug output when running LEDGER_VERBOSE=true.

This is a very small item but we should change this so that all outgoing ledger related requests are displayed.

@kjozwiak
Copy link
Member

kjozwiak commented Aug 14, 2018

Verified using macOS 10.13.6 with the following build:

  • 0.23.80 53a429f
  • muon: 8.0.8
  • libchromiumcontent: 68.0.3440.84

Verified on Ubuntu 18 x64 using

  • 0.23.80 53a429f
  • muon: 8.0.8
  • libchromiumcontent: 68.0.3440.84

image

Verified using Win 10 x64 with the following build:

  • 0.23.80 53a429f
  • muon: 8.0.8
  • libchromiumcontent: 68.0.3440.84

# for free to subscribe to this conversation on GitHub. Already have an account? #.