-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
/posts
endpoint pagination missing posts between two paginations
#76
Comments
Some notes: This only seems to happen with older posts.
|
I've been noticing something kind of like this on the Android app too—if I navigate to a specific post on somebody's blog, it's started showing me posts both before and after that one, instead of an API response that starts with that post. |
Hello! Looks like you found a bug. The underlying issue is that those "missing" posts and the last post(s) on the "page" all share the same user-set publish time. Because we store that timestamp in second-precision Unix epoch format, this can happen when using that as a pagination boundary. We'll see what we can do here to mitigate this. |
@fireattack Just wanted to let you know that unfortunately we aren't going to be able to pick up fixing this anytime soon. Fixing this would require us to most likely refactor how pagination works for blog posts, which is a pretty large undertaking. To mitigate this for now, I'd suggest reaching out to that blog to ask them not to set the post's public date to the same as other posts on their blog. Even adding 1 second between each timestamp would fix this issue. |
Take your time, but I'd say it has to be fixed eventually since it's a pretty serious bug. To make it clear, the good ol' https://api.tumblr.com/v2/blog/animage/posts?api_key={your_api_key}&offset=7989 gives 51450914667~51348709311 and https://api.tumblr.com/v2/blog/animage/posts?api_key={your_api_key}&offset=8009 gives 51460950351~51370155416, without missing any inbetween. And this was exactly what the official Another workaround I used is to just query again with (Anyway, I think you can understand that to ask random strangers to change their posting behavior is unrealistic, especially considering these posts are 8 years old :P ). |
Using
Definitely, it's frustrating, but if someone chooses to use the platform in a counterintuitive way, there are likely to be counterintuitive consequences. 😅 |
I use
https://api.tumblr.com/v2/blog/animage/posts?api_key={mykey}&before=1369715530
Response:
The 20 posts are:
I then request again for next page using the provided query_params:
https://api.tumblr.com/v2/blog/animage/posts?api_key={mykey}&before=1369715530&page_number=VCAMEqDRFTJ4JBptzxiHLECCfqCm_3KxgsPdWS_xW1eHdU55SVNqU3lYMHhGUVFCSUxwSjVFU0Fyb0dwT0RWdklIeTVoZHBlTVdMUzdQWnR5S3JzbERoWW1RWFV6MG5IZm50MWxWaUFTQWpoK2xKN2ZhbThoemNJU3ZGb29jNWdORk5SaFJYY1U4Mk5HcXBmSGV3ZGlicllqTTd2Y3NsZ1dCc2laTUdMcTU3ajQxeGk1Mm1uV1pFb05RQ05EdVlPYXVkRCtuaFlUUkJvcnVjUzZGNFFNOHVPV2hkTWViMU0wdnJQWTkrU3A4ZHdMT0hHWEJBd25tUnpXNHpYaE1uVHpZVUJKMTdzSEp2OXNRUHdJYXVkdjIzNlgrUjVPL3VBenpsVFRiVDlscW1HUkdvUWNaUTRsZUpSTVUxR3lZaEZScllhK2VXbmtBVlc4Yyt6MzdBc2Q0RHZUWkIzejNLMmtOMkl2R1kybzJ1VU5SakcweVlWTGlXU0IzdzZmYWtlUTZqR1JsYTgwUStSVDRhcUdRblgvNmN0MnprZHB6d3A2
You got next 20 posts:
However, there are two posts in-between:
are missing.
This is definitely caused by pagination, as if you just change the
before
timestamp to a little bit earlier, they will appear just fine:E.g. change before to 1369642261:
The text was updated successfully, but these errors were encountered: