Skip to content

feat: tell API clients which reply continues a commit as its author's thread - #1656

Draft
simonhamp wants to merge 1 commit into
dev-null-sh:productionfrom
simonhamp:feat/api-continuation-id
Draft

simonhamp wants to merge 1 commit into
dev-null-sh:productionfrom
simonhamp:feat/api-continuation-id

Conversation

@simonhamp

Copy link
Copy Markdown
Contributor

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 reduced replies_count, in the latest log and on a signed commit page. The exact-shape tests now include continuation_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.
  • phpstan on CommitResource.php: no errors.
  • pint --test: pass.
  • rector --dry-run: the new tests are clean. It still suggests importing names on lines of CommitControllerTest.php that 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.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant