pingdotgg / pingdotgg/t3code

[Bug]: Review submission fails on lines outside the PR diff and hides GitHub’s validation error

Open
#12,549 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug via-triage
Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/web

Steps to reproduce
  1. Open a GitHub pull request in T3 Code and start a review.
  2. Add an inline comment to unchanged context outside the diff hunks returned by GitHub. In my case, the comment was on line 1 of a modified file, while the first diff hunk started at line 2.
  3. Add other valid inline comments and submit the review using Comment.
  4. The entire review fails with a generic error.
  5. Move the out-of-diff comment to a valid line in the same file and submit again. In my case, moving it to the class declaration at line 24 made the review submit successfully.

The line-1 anchor was confirmed in the extracted draft as: { "kind": "context", "oldLine": 1, "newLine": 1, "side": "right" }.

Expected behavior

T3 should prevent or flag inline comment anchors that GitHub cannot accept. If submission is rejected, show the useful GitHub validation error and help identify the affected comment so it can be moved, while preserving the rest of the draft.

Actual behavior

The UI only reports “the review could not be submitted.” The server trace reports “GitHub CLI command failed” and a non-zero exit, without the useful validation message.

Submitting the same payload directly through gh api returned HTTP 422 with errors: ["Line could not be resolved"]. Comparing the comment anchors with GitHub’s PR diff identified one comment on line 1 outside the returned hunk. Moving that comment to line 24 (within the diff) resolved the problem.

Impact

Minor bug or occasional failure

Version or commit

Installed macOS app bundle reports 0.0.42 (T3 Code Alpha)

Environment

macOS; T3 Code (Alpha) desktop app; GitHub pull request review submitted through the GitHub CLI.

Logs or stack traces
UI: the review could not be submitted.

Server trace:
PullRequestOperationError: Pull request operation submitReview failed: GitHub CLI command failed.
VcsProcessExitError: gh exited with 1 - Process exited with a non-zero status.

Direct POST /repos/{owner}/{repo}/pulls/{number}/reviews:
HTTP 422 Unprocessable Entity
{
  "message": "Unprocessable Entity",
  "errors": ["Line could not be resolved"],
  "documentation_url": "https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request",
  "status": "422"
}
Screenshots, recordings, or supporting files

No response

Workaround

Move the comment from the unchanged line outside GitHub’s diff hunk to a valid line within the same file’s diff. Moving my comment from line 1 to the class declaration at line 24 allowed the review to submit successfully.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/web and trace the GitHub pull request review submission through the GitHub CLI path described in the issue. Reproduce the HTTP 422 “Line could not be resolved” case with an out-of-diff anchor, then verify that the affected comment is identified, the useful validation error is shown, and the remaining draft is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, shell, typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.