Summary
When an author replies to their own commit, the web shows the commit with Show thread and reads the thread in order on its page. The queries behind the API already work this out: they select continuation_id and take that reply out of replies_count and reply_preview. CommitResource never sent the field, though, so an app sees a reply count that leaves one reply out and has no way to tell which reply continues the thread.
The /dev/null app works around it today by loading each commit's replies to find the continuation. That means a self-thread with no other replies shows nothing in a log until it's opened.
Changes
CommitResource sends continuation_id next to replies_count, with whenHas, so it only appears where the query selected it. That covers the signed API's logs, profiles, search, starred commits, replies and a commit's page. It is null when there is no continuation. Unsigned requests (withPublicPreview()) don't select it, so the public read API is unchanged. Deleted commits keep their short shape.
KNOWLEDGE_BASE.md mentions the field in the paragraph on threads.
Validation
Local, PHP 8.5.13:
pest tests/Feature/Controllers/Api/LogControllerTest.php tests/Feature/Controllers/Api/CommitControllerTest.php: 133 passed. Two new tests check that a self-threaded commit sends its continuation and the reducedreplies_count, in the latest log and on a signed commit page. The exact-shape tests now includecontinuation_id.pest tests/Feature/Controllers/Api tests/Feature/Controllers/CommitControllerTest.php tests/Feature/Controllers/LogControllerTest.php tests/Unit/Queries: 1764 passed, 2 failed. Both failures ask for pages missing from this clone's Vite manifest (resources/js/pages/device/index.tsx), which I couldn't build without bun. They don't touch this change.phpstanonCommitResource.php: no errors.pint --test: pass.rector --dry-run: the new tests are clean. It still suggests importing names on lines ofCommitControllerTest.phpthat this PR doesn't touch.- Whole suite, JS tests and coverage: not run.
Independent review
Not done yet.
Limitations
None known. No JS or TS changed.
Activity
2This pull request is a draft
Merging is unavailable until it is marked ready for review.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share