bccsa / luminary

Offline-first content platform
Apache License 2.0
3 stars 2 forks source link

APP: Sort newest content by publish date #233

Closed ivanslabbert closed 1 month ago

ivanslabbert commented 1 month ago

Showing a random selection of content after updating production today:

Image

ivanslabbert commented 1 month ago

I believe the limit function in the query is perhaps using the updated time instead of the published time to sort before limiting.

belljohan3 commented 1 month ago

Hey @ivanslabbert !

As we updated the ContentTile component, i think this PR is alredy solve, because we are showing the publishDate of content. Also, when checking the query, it is using the publishDate. But if i am wrong, we can let me know and maybe discuss about

ContentTile: Image

The Query we have: Image

HomePage: Image

ivanslabbert commented 1 month ago

This one was a bit harder than I thought... The problem shows on the production release, so I cloned the database to staging, and pointed dev environment to the staging API.

The issue was that the query in the shared library (contentWhereTag) applied the limit function before the data was sorted, resulting in a strange selection if data. Adding a sort higher up in the query solves the issue (see PR #253 )