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

updateledgerinfo refactor #3430

Merged
merged 2 commits into from
Aug 27, 2016
Merged

updateledgerinfo refactor #3430

merged 2 commits into from
Aug 27, 2016

Conversation

diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Aug 25, 2016

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Ran git rebase -i to squash commits if needed.

consolidates calls for updating ledger info appstate, so it is less likely that ledgerInfo in appState will get out of sync with ledgerInfo in ledger.js

auditors: @mrose17

@@ -724,8 +725,6 @@ var updateLedgerInfo = () => {
var info = ledgerInfo._internal.paymentInfo
var now = underscore.now()

if (!client) return
Copy link
Member Author

Choose a reason for hiding this comment

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

@mrose17 says this was here because:

until client is defined, there isn’t any ledgerInfo so, yes, all the fields will be undefined.

however, as of https://github.com/brave/browser-laptop/pull/3432/files#diff-9b959b675446ba95e1abe0b81e0f7a9bR133, ledgerInfo does in fact have the creating property before client is created.

therefore i think this line above should be removed. if any calls to updateLedgerInfo require existence of client, they should do that check before calling updateLedgerInfo.

Copy link
Member

Choose a reason for hiding this comment

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

sure!

@bbondy
Copy link
Member

bbondy commented Aug 27, 2016

Merging for beat5, @mrose17 please audit afterwards.

@bbondy bbondy merged commit ebedb6c into master Aug 27, 2016
@mrose17
Copy link
Member

mrose17 commented Aug 27, 2016

@bbondy - i wouldn't merge this. i don't think that @diracdeltas is done with it yet. it's also possible that other merges may have OBE'd this...

@bbondy
Copy link
Member

bbondy commented Aug 27, 2016

was reverted here:
5e5c862

Please re-issue PR when ready Yan, sorry about that.

@diracdeltas diracdeltas deleted the fix/updateledgerinfo-refactor branch September 22, 2016 23:35
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.

4 participants