View Issue Details

IDProjectCategoryView StatusLast Update
0006559Talerwallet-corepublic2021-08-24 16:23
Reportergrote Assigned Togrote  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Target Version0.8Fixed in Version0.8 
Summary0006559: Transactions not sorted as documented
DescriptionThe transactions currently returned by wallet core are not sorted as documented. The Android wallet currently needs to re-sort them.
TagsNo tags attached.

Activities

Florian Dold

2020-09-04 08:24

manager   ~0016833

The wallet currently sorts transactions like this:

[ non-pending, ascending by time ]
[ pending, ascending by time ]

For the UI to show them in descending order, it just needs to reverse the list. No re-sorting required.

It's better to return the transactions in ascending order, since "ascending" is usually the default sorting order, and it is absolutely trivial for the UI to reverse the list before rendering.

Of course the wallet-core docs must be adjusted then.

grote

2020-09-04 14:02

developer   ~0016844

> For the UI to show them in descending order, it just needs to reverse the list. No re-sorting required.

Last time I checked, I needed to do a complete re-sort, as otherwise pending ended up at the bottom.

> It's better to return the transactions in ascending order, since "ascending" is usually the default sorting order

When is it the default sorting order? AFAIK, the wallet API should sort transactions how wallets would show them.

Florian Dold

2020-09-04 14:19

manager   ~0016846

Can you point out an example where the sorting is wrong (not just reversed)? We should have an integration test for that! Though the current integration test already checks the order for transactions. Maybe the pending transactions are sometimes not ordered correctly?

(Regarding default sorting order: Pretty much everything that sorts numbers/dates sorts them ascending by default. SQL, Python, JavaScript, etc. TBH the main reason that I don't want to switch is that the integration tests assume this order for transactions in various places, which is harder to change *and* goes against the "natural order" ;-) )

Florian Dold

2020-09-09 09:40

manager   ~0016941

Actually, the order of pending and non-pending transactions was reversed. It was

  [p1 p2] [f1 f2]

instead of

  [f1 f2] [p1 p2]

Now by just calling .reverse, the transactions will be sorted in "UI view order".

Issue History

Date Modified Username Field Change
2020-09-03 13:43 grote New Issue
2020-09-03 13:43 grote Status new => assigned
2020-09-03 13:43 grote Assigned To => Florian Dold
2020-09-04 08:24 Florian Dold Note Added: 0016833
2020-09-04 08:25 Florian Dold Assigned To Florian Dold => grote
2020-09-04 08:25 Florian Dold Status assigned => feedback
2020-09-04 14:02 grote Note Added: 0016844
2020-09-04 14:19 Florian Dold Note Added: 0016846
2020-09-09 09:40 Florian Dold Status feedback => resolved
2020-09-09 09:40 Florian Dold Resolution open => fixed
2020-09-09 09:40 Florian Dold Note Added: 0016941
2020-10-03 14:08 Christian Grothoff Fixed in Version => 0.8
2020-10-03 14:10 Christian Grothoff Target Version => 0.8
2021-08-24 16:23 Christian Grothoff Status resolved => closed
2023-04-13 20:36 Florian Dold Category wallet (TS core) => wallet-core