Skip to content

fix(discussions): forward parent entity id when replying to a thread#227

Open
jjuraszek wants to merge 1 commit into
linearis-oss:mainfrom
jjuraszek:fix/reply-missing-entity-id
Open

fix(discussions): forward parent entity id when replying to a thread#227
jjuraszek wants to merge 1 commit into
linearis-oss:mainfrom
jjuraszek:fix/reply-missing-entity-id

Conversation

@jjuraszek

Copy link
Copy Markdown

Problem

linearis issues reply <root-thread-id> --body "..." always fails:

GraphQL request failed: Argument Validation Error - Exactly one of
projectUpdateId, initiativeUpdateId, postId, documentContentId, projectId,
initiativeId or issueId must be defined.

replyToDiscussion built the CommentCreateInput with only parentId + body. Linear's commentCreate requires the parent entity id (issueId/projectId/initiativeId) in addition to parentId, even for a threaded reply. Root comments via issues discuss work because startIssueDiscussion passes issueId; only the reply path was missing it.

Fix

assertRootDiscussionThread already fetches the thread via GetDiscussionCommentContext, which selects all three entity ids. Capture its return value (previously discarded) and forward the correct id using the existing getDiscussionThreadEntity helper. No extra network call.

Test

Tightened the existing replyToDiscussion happy-path test to assert the second request forwards issueId alongside parentId. tsc --noEmit clean, biome check clean on both files, full discussion-service suite green (39/39).

(The unrelated calver-plugin unit test fails identically on a clean main checkout - date-based versioning, untouched here.)

Closes #226

replyToDiscussion built the CommentCreateInput with only parentId + body,
omitting the entity id (issueId/projectId/initiativeId) that Linear requires
even on a threaded reply, so every reply failed with:

  Argument Validation Error - Exactly one of ... issueId must be defined.

The thread context fetched by assertRootDiscussionThread already carries all
three ids; forward the right one via the existing getDiscussionThreadEntity
helper. No extra network call.

Closes linearis-oss#226
@jjuraszek jjuraszek requested a review from iamfj as a code owner June 10, 2026 18:10

@iamfj iamfj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for your contributon!

@iamfj

iamfj commented Jun 11, 2026

Copy link
Copy Markdown
Member

The CI issue seems to be unrelated to your change. Ill take care of it.

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.

2 participants