aaronpk / Aperture

Aperture is a Microsub server. Currently in beta.
https://aperture.p3k.io
Apache License 2.0
70 stars 5 forks source link

Timeline not always chronological #83

Closed janboddez closed 4 years ago

janboddez commented 4 years ago

Not sure if an edge case or not, but I recently saw a few newly added entries (from a newly added source) pop up at the top of my timeline, although they were originally published months ago. Also, within this group of entries, they were themselves not necessarily in the correct order.

"Fixed," it seems, by editing line 364 of the MicrosubController as follows:

      //->orderByDesc('channel_entry.created_at')
      ->orderByDesc('published')

Surely this somehow mixes up "pagination," but you get the idea. (Update: that can be worked around, too, but I'm sure there's a reason to show items as they've been added and not necessarily chronologically?)

aaronpk commented 4 years ago

This is actually intentional. The reason is because if it's sorted by published date, then when a new entry is discovered in a feed, it may appear somewhere seemingly random. I've seen a lot of feeds with incorrect published dates, for example timezone errors causing the times to be shifted by 8 hours, or just straight up bad published times that end up evaluating to 0. If you leave it this way for a week or so I guarantee you'll want to change it back because of all the "broken" feeds you'll encounter the other way :)

janboddez commented 4 years ago

Ah, interesting! I thought it'd be something like that.

I guess that if I just wait a bit longer and new entries are added (and purged, or expire), that these entries get added to channels more or less as they are published and the "problem" sort of disappears on its own.