indieweb / microsub

For tracking issues on the Microsub specification
23 stars 0 forks source link

A way to detect skipped posts #14

Open EdwardHinkle opened 6 years ago

EdwardHinkle commented 6 years ago

Over here (https://github.com/EdwardHinkle/indigenous-ios/issues/73#issuecomment-361597999) you mentioned the idea that a user that hasn't opened a Microsub app in a week might have 500 posts sitting in a channel and that it would be a lot of data to load.

This is actually a very realistic scenario, and one I would like to be able to tackle in Indigenous. My favorite current approach is Tweetbot's "Load Missing Tweets" tumblr_inline_n9yt8wvi0t1qz4hbm

How this would work is I would have the last posts I fetched when they previously opened the app (with it I would have that batches "before" token). When the channel is opened a week later, I do the standard timeline fetch with no modifiers, getting the current front posts as well as a before and after token.

What I would like to be able to do is to provide the "before" token from the previous group of posts, and the "after" token from the latest group of posts, and get an integer that provides how many posts exist in-between those two tokens. This would enable me to then provide a "load missing posts" button by using either the before token to get older posts or the after token to get newer posts. Eventually, removing the "Load Missing Posts" button when there are no more posts left. (I'm thinking it would technically load 10-20 posts for every click and provide some metric letting them know how many more posts are missing.

aaronpk commented 6 years ago

I like it. So it's almost like we need a version of the timeline action that returns just the counts instead of the items.

EdwardHinkle commented 6 years ago

Yeah, exactly. On timeline can you provide both a before AND after token? You definitely would want to be able to specify both in the "timelineCounts" method.

aaronpk commented 6 years ago

Yeah right now it will actually work with both before and after tokens. I guess that isn't made explicit in the spec, but it was just as easy to have the code work that way.

jalcine commented 2 years ago

This is to be implemented in Lighthouse with the following request format:

POST /microsub.example
Host: lighthouse.example

action=timeline&
method=count&
channel={uid} // optional
... other filter options ..
post-type[]=post-type
post-type[]=other-post-type

(Originally published at: https://jacky.wtf/2022/4/TB/TBc0eJN6Qa835FWGfME5znfR)