From 795473be55837b766e0833986efbed9817b59be5 Mon Sep 17 00:00:00 2001 From: TowyTowy Date: Wed, 15 Jul 2026 20:21:27 +0200 Subject: [PATCH] Fix home timeline rejecting empty max_id/min_id pagination params MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `GET /api/v1/timelines/home?max_id=` (empty value) fails validation because `min_id`/`max_id` use the `sometimes|integer` rule. The global `ConvertEmptyStringsToNull` middleware turns `?max_id=` into `null`, and since the field is present, `sometimes` does not skip it while `null` fails the `integer` rule — returning HTTP 422. Every other timeline/listing endpoint in this controller (timelinePublic, accountStatusesById, etc.) uses `nullable|integer` for these params, so `timelineHome` was the lone outlier. Mastodon-API clients such as Pixelfed for iOS send `max_id=` on first page load and could not paginate the home timeline. Switch `min_id`/`max_id` to `nullable|integer` to match the rest of the controller. Fixes #6610 Co-Authored-By: Claude --- app/Http/Controllers/Api/ApiV1Controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index f9878281a..e85afec64 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -2607,8 +2607,8 @@ class ApiV1Controller extends Controller $this->validate($request, [ 'page' => 'sometimes|integer|max:40', - 'min_id' => 'sometimes|integer|min:0|max:'.PHP_INT_MAX, - 'max_id' => 'sometimes|integer|min:0|max:'.PHP_INT_MAX, + 'min_id' => 'nullable|integer|min:0|max:'.PHP_INT_MAX, + 'max_id' => 'nullable|integer|min:0|max:'.PHP_INT_MAX, 'limit' => 'sometimes|integer|min:1', 'include_reblogs' => 'sometimes', ]);