This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 975
Entire ledger should be sorted before display #12119
Labels
bug/good-first-bug
feature/rewards
includes hints ╭(◔ ◡ ◔)/
A good first bugs w/ hints made by someone from the team.
perf
QA/checked-Linux
QA/checked-macOS
QA/checked-Win64
QA/test-plan-specified
refactoring
Milestone
Comments
bsclifton
added
bug/good-first-bug
feature/rewards
includes hints ╭(◔ ◡ ◔)/
A good first bugs w/ hints made by someone from the team.
perf
refactoring
labels
Nov 28, 2017
@bsclifton Can I work on this bug. |
@sergiorojasa sure, if you need you need any help don't hesitate to reach out. Thank you |
+1 to what @NejcZdovc said! Let us know if you have any questions, @sergiorojasa 😄 👍 |
@bsclifton What properties of the ledger-state.json do I hand-editing? |
@bsclifton @NejcZdovc Should the sorting on parsedData affect the ledger-state.json or should I create a new array and fill the array element with the transaction from parsedData and then sort the new array and pass it to getStateInfo(). |
@sergiorojasa yeah I think that we should only sort data from parsedData when we read it |
@sergiorojasa you can just modify
|
8 tasks
10 tasks
This was referenced Jun 11, 2018
This was referenced Jun 19, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bug/good-first-bug
feature/rewards
includes hints ╭(◔ ◡ ◔)/
A good first bugs w/ hints made by someone from the team.
perf
QA/checked-Linux
QA/checked-macOS
QA/checked-Win64
QA/test-plan-specified
refactoring
Test plan
#12448 (comment)
Description
Naturally (ex: just by using Brave), the transactions shown in History under Preferences > Payments will be in order. The newest transactions will be at the top and the older ones towards the bottom. However, you can (for testing purposes) generate a fake history which would put things in the wrong order (this was fixed with #12118)
The original sorting fix was done by @josiah-keller when fixing #11300 and works great. However, it has the following problems:
it runs each time the view is shown
it only sorts what is stored in
ledgerData.get('transactions')
. If the state has things out of order, this could potentially leave out entries. Thanks to @NejcZdovc for sharing this logic ingetStateInfo
:browser-laptop/app/browser/api/ledger.js
Lines 1333 to 1335 in 9da47f4
If the timestamp is older than a year, the for loop stops☹️
browser-laptop/app/browser/api/ledger.js
Line 1382 in 9da47f4
The ideal fix would:
The change could go here:
browser-laptop/app/browser/api/ledger.js
Line 1782 in 9da47f4
parsedData
contains the raw JSON blob for theledger-state.json
, which includes all the transactions. The sort that was done in #12118 could be done here too, before the call togetStateInfo
Brave Version
about:brave info:
Reproducible on current live release:
yes- but only by hand-editing the
ledger-state.json
Additional Information
cc: @josiah-keller in case you wanted to give this one a shot 😄
The text was updated successfully, but these errors were encountered: