Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong sort order #713

Open
gerroon opened this issue May 24, 2018 · 3 comments · May be fixed by #1161
Open

Wrong sort order #713

gerroon opened this issue May 24, 2018 · 3 comments · May be fixed by #1161
Labels

Comments

@gerroon
Copy link

gerroon commented May 24, 2018

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
Copy link
Author

gerroon commented May 24, 2018

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.

NWuensche added a commit to NWuensche/android-app that referenced this issue Aug 17, 2019
When restarting the app, now the articles get sorted in the way they
were ordered before. This is done by not only checking the
savedInstanceState for sorting order but also the settings.

Close wallabag#797
Close wallabag#781
Close wallabag#713
@devkonarev
Copy link

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.

@di72nn
Copy link
Member

di72nn commented May 6, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants