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

Notify users when contribution date is pushed back #14006

Merged
merged 1 commit into from
May 8, 2018

Conversation

NejcZdovc
Copy link
Contributor

@NejcZdovc NejcZdovc commented May 3, 2018

Resolves #14000

new notification
image

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed. (Ask a Brave employee to help if you cannot access this document.)

Test Plan:

  1. add one site to the ledger table (with time spent less then 30min)
  2. add funds
  3. close browser and change reconcile stamp to yesterday
  4. make sure that date is pushed back for 3 days from the stamp that you set and that you see notification as is shown in the print screen (it can be pushed back for 6 days after restart)

Reviewer Checklist:

  • Request a security/privacy review as needed if one was not already requested.

Tests

  • Adequate test coverage exists to prevent regressions
  • Tests should be independent and work correctly when run individually or as a suite ref
  • New files have MPL2 license header

@NejcZdovc NejcZdovc added this to the 0.22.x Release 3 (Beta channel) milestone May 3, 2018
@NejcZdovc NejcZdovc self-assigned this May 3, 2018
@NejcZdovc
Copy link
Contributor Author

NejcZdovc commented May 3, 2018

blocked on brave-intl/bat-client#66

@jasonrsadler
Copy link
Contributor

jasonrsadler commented May 7, 2018

~~~Waited approximately 2 minutes for the switchover~~~
~~~Let me know if this is intended.~~~
See comment below.

Copy link
Contributor

@jasonrsadler jasonrsadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT
Something went haywire with npm and gave me an old version of bclient from a clean build.]


So I get the '30 minute' message but I get pushed out 6 days following that test plan.

@jasonrsadler
Copy link
Contributor

@bradleyrichter for wording

@NejcZdovc
Copy link
Contributor Author

Updated text based on @bradleyrichter feedback

@@ -192,6 +192,7 @@ const appConstants = {
APP_ON_LEDGER_PIN_PUBLISHER: _,
APP_ON_LEDGER_NOTIFICATION_INTERVAL: _,
APP_ON_LEDGER_MEDIA_DATA: _,
APP_ON_FUZZING: _,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be changed to something like APP_ON_LEDGER_FUZZING?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -1981,6 +1981,13 @@ const appActions = {
})
},

onFuzzing: function (newStamp) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following other comment, maybe this should be onLedgerFuzzing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

ryanml
ryanml previously approved these changes May 7, 2018
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other comment left, besides the issue that @jasonrsadler logged to what will be another PR, lgtm

@@ -503,6 +503,15 @@ const ledgerReducer = (state, action, immutableAction) => {
state = ledgerApi.onFetchReferralHeaders(state, action.get('error'), action.get('response'), action.get('body'))
break
}
case appConstants.APP_ON_LEDGER_FUZZING:
{
state = ledgerState.setAboutProp(state, 'status', ledgerStatuses.FUZZING)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set this prop after newStamp has been validated on line 510?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that as soon as fuzzing is triggered we should display notification, even if something was not send over correctly. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds fine yeah, I just assumed that if the check failed the process to that point would be so quick it may not be worth it.

@@ -2386,6 +2386,10 @@ const onInitRead = (state, parsedData) => {
return state
}

const onFuzzing = () => {
appActions.onLedgerFuzzing(client.state.reconcileStamp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for client.state != null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

null check added

@jasonrsadler jasonrsadler self-requested a review May 7, 2018 18:50
Copy link
Contributor

@jasonrsadler jasonrsadler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check client.state or client.state.reconcileStamp == null?

Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the changes

@NejcZdovc NejcZdovc merged commit bced563 into brave:master May 8, 2018
NejcZdovc added a commit that referenced this pull request May 8, 2018
Notify users when contribution date is pushed back
NejcZdovc added a commit that referenced this pull request May 8, 2018
Notify users when contribution date is pushed back
@NejcZdovc
Copy link
Contributor Author

master bced563
0.23 ef994a7
0.22-release3 187f889

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

Successfully merging this pull request may close these issues.

Notify user why contribution is pushed back (30 minute min browsing time)
3 participants