Skip to content

Conversation

@Hais
Copy link
Owner

@Hais Hais commented Dec 18, 2025

Summary

When the triggering event is pull_request_review_comment but the actual comment created was a fallback issue comment (due to pending review error), the update-comment-link script 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:

  1. User triggers @cuvvy via PR review comment
  2. Initial comment reply fails with "user_id can only have one pending review per pull request" (HTTP 422)
  3. Fallback creates an issue comment instead
  4. Claude runs successfully
  5. update-comment-link fails 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

  • Test with a normal PR review comment trigger (should still work)
  • Test the fallback scenario (if reproducible) where issue comment is created instead of PR review comment reply

🤖 Generated with Claude Code

When the triggering event is pull_request_review_comment but the actual
comment created was a fallback issue comment (due to pending review error),
the update-comment-link script 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).

This fixes the scenario where:
1. User triggers @cuvvy via PR review comment
2. Initial comment reply fails with "user_id can only have one pending review"
3. Fallback creates an issue comment instead
4. Claude runs successfully
5. update-comment-link fails trying to fetch the issue comment via pulls API

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Hais Hais force-pushed the fix/fallback-issue-comment-on-404 branch from fa3c208 to 80f70b3 Compare December 18, 2025 13:25
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