dimkr / tootik

A federated nanoblogging service with a Gemini frontend.
gemini://hd.206267.xyz
Apache License 2.0
93 stars 3 forks source link

Fetched posts displaying out of order #33

Closed locrianz closed 6 months ago

locrianz commented 6 months ago

I would expect posts to display in reverse chronological order (newest at the top) and for the most part this is what happens, but not always. Quite often posts get shuffled around, and replies can even appear underneath the posts they're replying to. I don't think this is even a matter of server timezones, because I've seen this happen to my own replies to my own posts.

See my local page for examples -- gemini://toot.locrian.zone/users/local.

I'm happy to provide stuff from my sqlite database or logs if you need it, but please let me know what specifically to look for.

And I don't know if I said this before, but thank you for writing this wonderful piece of software. It fills a hole in my life I didn't know was there.

dimkr commented 6 months ago

This is not a bug, posts are sorted so you don't miss stuff (for example, one noisy person or bot is enough to prevent you from reading more relevant posts, seeing a reply to your post, seeing a DM, etc'). Also, sorting by time in descending order doesn't work because this breaks paging and becomes an endless stream of posts.

https://github.com/dimkr/tootik/blob/32ce253918a84c6c78affeeb60642ff548be6563/front/inbox.go#L116

https://github.com/dimkr/tootik/blob/32ce253918a84c6c78affeeb60642ff548be6563/front/public.go#L42