Browser-laptop: Brave payments wrong contribution date

Created on 16 Sep 2016  路  19Comments  路  Source: brave/browser-laptop

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:
Qchecked-Win32 Qchecked-Win64 Qchecked-macOS bug featurrewards

All 19 comments

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!

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

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?

@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?

yes, thanks!

Unfortunately I have to reopen this. It seems not fixed after I have upgraded to the latest 0.12.3 production build.

Today is 4th of October and this is what I see:

@Sh1d0w thanks for the feedback! it looks the fix made only resets the date when you toggle the Payments enabled off/on switch.

maybe we should also reset the date if there's insufficient balance & reconcile date is in the past?

if you'd like a work around, i think adding funds (to cause an immediate reconciliation) or toggling payments will reset the date.

@ayumi The switch was turned off for a long time. After the update to 0.12.3 I decided to test if the issue is resolved, so I switched it on and I saw the problem still persists. I toggled it then off/on several times with no difference.

@Sh1d0w got it, thank you

Unfortunately I have to reopen this issue again. I don't know how you test this guys but after I installed 0.12.4 the text now reads:

Next contribution date: a month ago

I don't know why it is so hard to put a simple check:

If the value for next contribution date is less than today date, increment it with X days (whatever is the billing cycle set) :)

If you need any session files or stuff let me know I will provide.

@Sh1d0w - hi. the answer to your question is that we have different views of the issue. if you turn off your laptop the day before the recocilation date, and turn it back on two days later, i don't view that as sufficient to skip that reconcilation. the current test is this:

      let ledgerWindow = (synopsis.options.numFrames - 1) * synopsis.options.frameSize
      if (typeof timeUntilReconcile === 'number' && timeUntilReconcile < -ledgerWindow) {

in production, ledgerWindow evaluates to 29 days (the frameSize is 86400 seconds, the numFrames is 30 days).

if this window is two large, we can change it to something smaller, though i'm not particularly keen on seeing it less than 5 days... thanks!

@mrose17 It is up to you to decide how you want this to work. But from the point of view of a regular user who funds his wallet to support his fav websites, it is strange to see the text Next contribution date: a month ago :) This means nothing to the user.

@mrose17 Btw I haven't noticed payments are dependant on the browser to be opened? I think this should be implemented server side, rather than in the browser. Don't know what is the decision behind this, but for sure you can't rely on the client for the payments, as users may have unregular usage of the browser, considering the fact it is not fuly stable. And even if it is, same applies.

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.

@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!

@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)

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

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

thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eljuno picture eljuno  路  3Comments

jkup picture jkup  路  3Comments

stevespringett picture stevespringett  路  3Comments

jonathansampson picture jonathansampson  路  3Comments

bsclifton picture bsclifton  路  3Comments