fix: fallback to issue comment API when PR review comment fetch fails #4
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
When the triggering event is
pull_request_review_commentbut the actual comment created was a fallback issue comment (due to pending review error), theupdate-comment-linkscript would fail with 404 because it only tried the PR review comment API.This change wraps the PR review comment fetch in its own try-catch so it can fall through to try the issue comment API when the PR review comment fetch fails (e.g., 404).
Problem
This fixes the scenario where:
"user_id can only have one pending review per pull request"(HTTP 422)update-comment-linkfails trying to fetch the issue comment via the PR review comments API (404)Example failure: https://github.com/cuvva/app-cuvva-android/actions/runs/20337962345/job/58429260193
Test plan
🤖 Generated with Claude Code