scroll: return 204 instead of 404 for empty scroll responses

404 means the resource doesn't exist; 204 (No Content) correctly signals
that pagination reached the end. The JS fetch handler now checks for any
non-2xx status instead of only 404, so it stops scrolling on 204 too.
This commit is contained in:
4cuck committed 2026-03-07 23:58:48 -05:00
1 parent a7f9a24f29
commit 77c083e013
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -40,7 +40,7 @@ window.onload = function () {
url.searchParams.append("scroll", "true");
fetch(url.toString()).then(function (response) {
if (response.status === 404) throw "error";
if (response.status > 299) throw "error";
return response.text();
}).then(function (html) {
+1 -1
View File
@@ -168,7 +168,7 @@ async fn status(
// Check this first — paginated responses don't include the main tweet.
if is_scroll {
if conversation.replies.content.is_empty() {
return Ok(StatusCode::NOT_FOUND.into_response());
return Ok(StatusCode::NO_CONTENT.into_response());
}
let content = render_reply_chains(
&conversation.replies.content,