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

Brave payments wrong contribution date #4058

Closed
Sh1d0w opened this issue Sep 16, 2016 · 19 comments · Fixed by #4516
Closed

Brave payments wrong contribution date #4058

Sh1d0w opened this issue Sep 16, 2016 · 19 comments · Fixed by #4516

Comments

@Sh1d0w
Copy link

Sh1d0w commented Sep 16, 2016

Did you search for similar issues before submitting this one?
No

Describe the issue you encountered:
I have enabled Brave payments long ago and disabled it for a while. After re-enabling it again the Next contribution date was in the past.

Expected behavior:
The next contribution date should never be in the past.

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    All
  • Brave Version:
    0.12.1
  • Steps to reproduce:
    1.Enable Brave payments
    1. Disable Brave paymetns
    2. Wait several days and re-enable
  • Screenshot if needed:

- Any related issues:
@Sh1d0w Sh1d0w added this to the 0.12.2dev milestone Sep 16, 2016
@mrose17
Copy link
Member

mrose17 commented Sep 17, 2016

i agree that the next contribution date should't be in the past. what is the correct behavior, do you think?

should the browser add the length of time that brave payments was disabled to the next contribution date? or should it reset it to 30 days from the time that brave payments was last enabled? thanks!

@mrose17 mrose17 modified the milestones: 0.12.3dev, 0.12.2dev Sep 17, 2016
@Sh1d0w
Copy link
Author

Sh1d0w commented Sep 17, 2016

I think the correct behaviour should be to reset the 30 days timer from the date that you have enabled them again, just like you do for a first time.

cc @bbondy for confirmation

@mrose17
Copy link
Member

mrose17 commented Sep 17, 2016

here's a counter-example: suppose someone switches it off and then back on again within a second or two. should the time really be reset in that case? shouldn't there be a hold-down period?

@Sh1d0w
Copy link
Author

Sh1d0w commented Sep 17, 2016

@mrose17 It should reset only if the next contribution date is in past, not when you turn on/off the switch. For example my Next contribution date is 28 of August. If today is 1st of August it does not makes sense to increment it, since that date is in the future. But if today is 29th of August it should extend because it is in the past. Does this makes sense?

@mrose17
Copy link
Member

mrose17 commented Sep 17, 2016

yes, thanks!

@ayumi ayumi self-assigned this Sep 19, 2016
mrose17 added a commit that referenced this issue Sep 22, 2016
in preparation to resolve
#3350 (by using
`client.recoverWallet`) and
#4058 (by using
`client.setTimeUntilReconcile`)
ayumi added a commit that referenced this issue Sep 27, 2016
Fix #4058

Auditors: @mrose17

Test Plan:
1. Open Brave
2. Enable Payments then disable
2. Close Brave
3. Edit {userData}/ledger-state.json `reconcileStamp` to be way in the past (change 14.. to 13..)
4. Open Brave
5. Enable Payments
6. Note that contribution date is today + 30 days, rather than way in the past
ayumi added a commit that referenced this issue Sep 27, 2016
Fix #4058

Auditors: @mrose17

Test Plan:
1. Open Brave
2. Enable Payments then disable
2. Close Brave
3. Edit {userData}/ledger-state.json `reconcileStamp` to be way in the past (change 14.. to 13..)
4. Open Brave
5. Enable Payments
6. Note that contribution date is today + 30 days, rather than way in the past
@diracdeltas
Copy link
Member

diracdeltas commented Oct 10, 2016

i agree with @Sh1d0w that no matter what ledger is actually doing, the UI should never say "Next contribution: <date in past>". if that is the case, maybe s/next/last so at least it's not a paradox.

@mrose17
Copy link
Member

mrose17 commented Oct 11, 2016

@diracdeltas - thanks. just so i'm clear: would you be happy with "Your last contribution was due 10 days ago."

@Sh1d0w - everything with respect to contributions is voluntary, and purposely so. it turns out that this allows the browser to drive the interactions entirely. that's not normally the way things are done in the payments world, but that's fine for this application!

@Sh1d0w
Copy link
Author

Sh1d0w commented Oct 11, 2016

@mrose17 I see your point. What about the following approach:

  1. User starts the browser
  2. Brave check if the next contribution date is in the past
  3. If it is in the past transaction is created with the monthly amount
  4. The new Next payment date is set 30 days from today (the date the payment is done)

@diracdeltas
Copy link
Member

What if instead of saying Next contribution it just said Contribution due date?

@mrose17 mrose17 modified the milestones: 0.12.7dev, 1.0.0, 0.12.8dev Oct 22, 2016
@mrose17
Copy link
Member

mrose17 commented Oct 25, 2016

@diracdeltas - could i ask you to make the change you suggest and then close this issue, thanks!

@diracdeltas diracdeltas modified the milestones: 0.12.7dev, 0.12.8dev Oct 25, 2016
@diracdeltas diracdeltas self-assigned this Oct 25, 2016
@mrose17
Copy link
Member

mrose17 commented Oct 25, 2016

thanks!

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