Repository navigation
fix: handle null review comment commit in parseGraphQLComment (fixes #9159) - #9168
Merged
Alex Ross (alexr00) merged 2 commits intoNov 11, 2026
Merged
Conversation
Contributor
Author
|
@microsoft-github-policy-service agree company=zentomedia.net |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to handle review comments with null commits.
No open issues 🎉
What changed in this PR
Fixes #9159 by allowing review comments with null commits to be parsed without blocking the pull request timeline.
Changes:
- Uses optional chaining when reading a review comment’s commit OID.
- Makes
commitandoriginalCommitoptional and nullable in the GraphQL interface. - Adds a regression test verifying that null commits are handled while preserving the original commit ID.
| File | Description |
|---|---|
src/test/github/utils.test.ts |
Adds regression coverage for review comments with null commits. |
src/github/utils.ts |
Safely reads the commit OID with optional chaining. |
src/github/graphql.ts |
Updates review-comment types to allow absent or null commits. |
Review effort: Balanced
…icrosoft#9159) When review comments are detached or outdated following a rebase/force-push, GitHub GraphQL API returns null for the comment's commit object. Directly accessing comment.commit.oid resulted in an unhandled TypeError. Safely access comment.commit?.oid with fallback to comment.originalCommit?.oid. Includes unit test verifying parsing behavior when commit is null.
Uong Dong Hung (hungud)
force-pushed
the
fix/9159-null-commit-typeerror
branch
from
November 11, 2026 07:33
9231b83 to
9c35f39
Compare
Member
|
/AzurePipelines run |
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. |
Alex Ross (alexr00)
enabled auto-merge (squash)
November 11, 2026 10:36
Alex Ross (alexr00)
approved these changes
Nov 11, 2026
Alex Ross (alexr00)
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR!
Member
|
/AzurePipelines run |
|
Azure Pipelines: 2 pipeline(s) were filtered out due to trigger conditions. |
roblourens
approved these changes
Nov 11, 2026
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.
Description
Fixes #9159
When a Pull Request has detached or outdated review comments (e.g. after a rebase or force-push), the GitHub GraphQL API returns
commit: null. Attempting to accesscomment.commit.oidthrows an uncaughtTypeError: Cannot read properties of null (reading 'oid'), preventing the Pull Request timeline from opening.Changes
commitId: comment.commit?.oid,insrc/github/utils.ts.GraphQL.ReviewCommentinterface insrc/github/graphql.tsto reflect nullable commit schema (commit?: { oid: string } | null;).src/test/github/utils.test.tscovering review comments withnullcommit.Verification & QA Proofs
1. VS Code GUI Action Verification
View Red GUI (VS Code PR Description View Crash)
View Green GUI (Clean UI - PR Timeline Loaded Safely)
2. Unit & Integration Test Proofs
View Terminal Test Execution
Contributed by Henry U. (Uong Dong Hung)