Conversation
ListComments read GET /{media-id}/replies, which returns only the
top-level replies to a post. A reply to a reply, such as a follower
answering the account's own reply, never reached the inbox. Read
GET /{media-id}/conversation instead, which returns replies at every
depth with the same fields, and thread each one under replied_to.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 14 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ThreadsAdapter.ListCommentsreadGET /{media-id}/replies, which returns only the top-level replies to a post. Any reply to a reply never reached the engagement inbox. That includes the most common follow-up, a follower answering the account's own reply. This change readsGET /{media-id}/conversationinstead, which returns replies at every depth, and setsParentIDfromreplied_toso the inbox threads each reply under the one it answers.Motivation
From the Threads Replies and Conversations reference:
/replies"only returns the top-level replies under the Threads ID provided in the request"./conversation"returns all replies, regardless of the depth, either in chronological or reverse chronological order". Itsreverseparameter defaults totrue(newest first), the same as/replies.is_reply_owned_by_meandhide_status, which the adapter already reads. They need the same permission, since the reference's permission list scopes it to GET calls on reply endpoints.replied_tois "Media ID of the immediate parent of the reply" and is returned as{"id": ...}.This is the same gap #257 closed for PieFed's reply tree.
Threading follows what the other adapters already do (#240). A nested reply's
ParentIDis the ID of the reply it answers, which the inbox matches againstremote_id. A top-level reply'sreplied_tois the post itself, which is not a collected comment, so it still shows as top level. The account's own replies keepIsOursfromis_reply_owned_by_me, so they stay out of the inbox as before.Testing
go test ./internal/platform/...)bun run --filter @openpost/web test): no frontend changego vet,gofmt,gofumpt,golangci-lint run ./internal/platform/...: 0 issues, same asmain)TestThreadsListCommentsCollectsNestedRepliesserves both edges the way the reference describes them./repliesholds only the top-level reply, and/conversationholds it plus the account's own reply and a follower's answer to that reply. The test checks that all three are collected, that the follow-up is threaded under the account's reply, and that ownership is kept.TestThreadsListCommentsMarksOwnRepliesAsOursnow expects the/conversationpath.Fails on unmodified
main:Passes with the fix.
go test ./internal/platform/...isok, andgo build -tags dev ./...is clean.go test -coverprofileshows every changed line runs under the tests. I have not tested this against a live Threads account. The behavior is taken from the reference quoted above.Checklist
changes/threads-nested-replies.mdBreaking Changes
Affected Components
Platform Impact
🤖 Generated with Claude Code