android-app icon indicating copy to clipboard operation
android-app copied to clipboard

Wrong sort order

Open gerroon opened this issue 6 years ago • 3 comments

Hi

Using 2.0.2 app on Lollipop and 2.3.2 on the server side.

Everything seems to work except that the sort order is shown oldest to newest when the app is open. But the newly added article (either via the app or the server) shown at the top as the first one which is expected but the second article at the top is the oldest article ever bagged.

The weird thing is that if I reverse the article sort order using the ui button, the newly added article is not show anymore however the order is almost equal to how server web ui list the articles except that the newly added article is not shown at the top.

thanks

gerroon avatar May 24 '18 03:05 gerroon

Btw the sorting on the server is always as intended whether there is a new article or not. So definetely newly added articles are dated properly, this seems to be an issue in the Android app.

Also this issue arised after I upgraded the Wallabag to 2.3.2 I think I was using something like 2.2 before.

gerroon avatar May 24 '18 18:05 gerroon

Hi,

I managed to reproduce the issue when migrating from one wallabag instance to another. Wallabag server v.2.4.2, Android app v.2.4.2.

Steps to reproduce:

  • Deploy a wallabag server with sqlite database, create a user, add some articles (I had around 700), export articles using wallabag:export command
  • Deploy another wallabag server with Mariadb database, create a user, import articles using wallabag:import command, add some new articles, connect the Android app to this server and check the order of articles

Observations: wallabag_entry table on the first server:

| id | created_at |
| 1  | date1      |
| 2  | date2      |
| 3  | date3      |

Both id and created_at values are in ascending order.

wallabag_entry table on the second server immediately after import:

| id | created_at |
| 1  | date3      |
| 2  | date2      |
| 3  | date1      |

id values are in ascending order but created_at values are in descending order. Most probably this is due to the fact that the export file contains newest articles first so they are imported in that order.

wallabag_entry table on the second server after adding some new articles:

| id | created_at |
| 1  | date3      |
| 2  | date2      |
| 3  | date1      |
| 4  | date4      |

It feels like article ordering in the Android app is based on the id value. Manually updating ids to make both id and created_at values in ascending order fixes the problem.

devkonarev avatar Apr 27 '21 21:04 devkonarev

It feels like article ordering in the Android app is based on the id value.

That is indeed the case. Thanks for pointing out the situation where it doesn't work.

di72nn avatar May 06 '21 13:05 di72nn