[MastoAPI] /timelines/home sometimes returns fewer results than it should
Occasionally, calls to MastodonAPI's home timeline will return fewer than limit
results, despite there being more
results available.
Can produce on my instance with the following:
fetch("https://ihatebeinga.live/api/v1/timelines/home?max_id=9fOHh2gg3RT9oG1VXE&limit=20",
{headers: {"authorization": auth_header}}
)
.then(resp => resp.json())
.then(resp => {
console.log(resp.length);
console.log("LAST ID", resp[resp.length-1].id);
});
>>> 18
>>> LAST ID 9fOFvIRs3Go8q0lbpA
Giving 18 results. However, querying on the oldest ID returned in that query,
fetch("https://ihatebeinga.live/api/v1/timelines/home?max_id=9fOFvIRs3Go8q0lbpA&limit=2",
{headers: {"authorization": auth_header}}
)
.then(resp => resp.json())
.then(resp => {
console.log(resp.length);
});
>>> 2
gives the 2 results that should have filled the first query to the limit
of 20
I imagine there's some filtering going on after the limit is applied somewhere, but I'm yet to find it.