quick-review - Handle errors with pending reviews#9525
Merged
Conversation
1 task
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/1534d0e1-81ce-486c-9a04-56db1afaf1be Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/1534d0e1-81ce-486c-9a04-56db1afaf1be Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/1534d0e1-81ce-486c-9a04-56db1afaf1be Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/1534d0e1-81ce-486c-9a04-56db1afaf1be Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix 'Approve now' failure when pending review exists
Handle pending-review validation errors in May 19, 2026
quick-review “approve now”
fregante
reviewed
May 19, 2026
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/2a4ad392-1876-4c75-a764-08e85ef2f2cb Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/2a4ad392-1876-4c75-a764-08e85ef2f2cb Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Agent-Logs-Url: https://github.com/refined-github/refined-github/sessions/2a4ad392-1876-4c75-a764-08e85ef2f2cb Co-authored-by: fregante <1402241+fregante@users.noreply.github.com>
Copilot
AI
changed the title
Handle pending-review validation errors in
Handle pending-review errors in May 19, 2026
quick-review “approve now”quick-review “approve now”
quick-review “approve now”quick-review - Handle errors with pending reviews
fregante
approved these changes
May 19, 2026
fregante
approved these changes
May 19, 2026
| } | ||
|
|
||
| const call = api.v3(`pulls/${getConversationNumber()!}/reviews`, { | ||
| const call = api.v3uncached(`pulls/${getConversationNumber()!}/reviews`, { |
Member
There was a problem hiding this comment.
Bugfix:
- pending review
- fail to quick-review
- delete pending review
- fail to quick-review because cached
| //https://github.com/refined-github/refined-github/pull/9525 | ||
| Array.isArray(apiResponse.errors) | ||
| ? apiResponse.errors.join('.\n') | ||
| : JSON.stringify(apiResponse, undefined, '\t'), // Beautify |
Member
There was a problem hiding this comment.
Not great, but it works. PR welcome to unfuck this cluster.
The error is
{
"message": "Unprocessable Entity",
"errors": [
"User can only have one pending review per pull request"
],
"documentation_url": "https://docs.github.com/rest/pulls/reviews#create-a-review-for-a-pull-request",
"status": "422"
}
Comment on lines
102
to
-98
| throw error; | ||
| } finally { | ||
| // Use the last message if `false` was passed | ||
| void finalUpdateToast(finalToastMessage || lastRawMessage); |
Member
There was a problem hiding this comment.
Error thrown means finally isn't hit. That's why the message was not being updated at all
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.
quick-review- "Approve now" fails if there's a pending review #9421Test URL
Here, or any open PR
Before
After