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

Adding decimal value to pinned site cause it to unpin #12001

Closed
srirambv opened this issue Nov 16, 2017 · 3 comments · Fixed by #13267
Closed

Adding decimal value to pinned site cause it to unpin #12001

srirambv opened this issue Nov 16, 2017 · 3 comments · Fixed by #13267

Comments

@srirambv
Copy link
Collaborator

Description

Adding decimal value to pinned site cause it to unpin

Steps to Reproduce

  1. Enable payments, visit few sites to add it to ledger
  2. Pin 3-4 sites in the ledger table
  3. Change one of the pinned site value to random decimal value
  4. Site gets unpinned

Actual result:
pinned value

Expected result:
Should not unpin the publisher and retain the original value

Reproduces how often:
100%

Brave Version

about:brave info:

Brave 0.19.95
rev cc0ebad
Muon 4.5.16
libchromiumcontent 62.0.3202.94
V8 6.2.414.42
Node.js 7.9.0
Update Channel Release
OS Platform Microsoft Windows
OS Release 10.0.15063
OS Architecture x64

Reproducible on current live release:
Yes, same behaviour on 0.19.88

Additional Information

#11369 #11238 #10534
cc: @mrose17 @NejcZdovc @bsclifton

@srirambv srirambv added bug feature/rewards needs-investigation A bug not 100% confirmed/fixed that needs QA to better audit. labels Nov 16, 2017
@srirambv srirambv added this to the Triage Backlog milestone Nov 16, 2017
@luixxiul luixxiul added the 0.19.x issue first seen in 0.19.x label Nov 21, 2017
@cezaraugusto cezaraugusto added the priority/P4 Minor loss of function. Workaround usually present. label Nov 21, 2017
@bsclifton bsclifton modified the milestones: Triage Backlog, Prioritized Backlog Nov 21, 2017
ryanml added a commit to ryanml/browser-laptop that referenced this issue Feb 23, 2018
@ryanml
Copy link
Contributor

ryanml commented Feb 23, 2018

I was taking a look at this one, and it seems that inside the PinnedInput component, the callback for onBlur was interpreting decimal values as falsey, causing them to be unpinned.

Doing that additional check here solves the unpin issue, but I'm not sure if the expectation here is that they be reset to 1. I can only assume so, as the previous check was for values less than one.

Let me know your thoughts on this one and I can change as needed and open up a PR. See: here

cc: @NejcZdovc @srirambv

@NejcZdovc
Copy link
Contributor

@ryanml yeah we need to always default to 1 if you are bellow 0 or value is not a number

@btlechowski
Copy link
Contributor

btlechowski commented Jun 14, 2018

Verified on Ubuntu 17.10 x64

  • 0.23.8 06c657b
  • Muon 6.1.5
  • libchromiumcontent 66.0.3359.181

Verified on Windows 10 x64
• 0.23.8 06c657b
• Muon 6.1.5
• libchromiumcontent 66.0.3359.181

Verified with macOS 10.12.6 using

  • 0.23.11 6565c06
  • Muon 7.1.0
  • libchromiumcontent 67.0.3396.87

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