Skip to content

quick-review - Handle errors with pending reviews#9525

Merged
fregante merged 14 commits into
mainfrom
copilot/fix-approve-now-fails
May 20, 2026
Merged

quick-review - Handle errors with pending reviews#9525
fregante merged 14 commits into
mainfrom
copilot/fix-approve-now-fails

Conversation

Copilot AI commented May 19, 2026

Copy link
Copy Markdown
Contributor

Test URL

Here, or any open PR

Before

Screenshot 12

After

Screenshot 13

Copilot AI changed the title [WIP] Fix 'Approve now' failure when pending review exists Handle pending-review validation errors in quick-review “approve now” May 19, 2026
Copilot AI requested a review from fregante May 19, 2026 10:35
Comment thread source/github-helpers/api.tsx Outdated
Copilot AI changed the title Handle pending-review validation errors in quick-review “approve now” Handle pending-review errors in quick-review “approve now” May 19, 2026
Copilot AI requested a review from fregante May 19, 2026 10:49
@fregante fregante changed the title Handle pending-review errors in quick-review “approve now” quick-review - Handle errors with pending reviews May 19, 2026
@github-actions github-actions Bot added the bug label May 19, 2026
}

const call = api.v3(`pulls/${getConversationNumber()!}/reviews`, {
const call = api.v3uncached(`pulls/${getConversationNumber()!}/reviews`, {

@fregante fregante May 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugfix:

  1. pending review
  2. fail to quick-review
  3. delete pending review
  4. fail to quick-review because cached

Comment thread source/github-helpers/api.tsx Outdated
//https://github.com/refined-github/refined-github/pull/9525
Array.isArray(apiResponse.errors)
? apiResponse.errors.join('.\n')
: JSON.stringify(apiResponse, undefined, '\t'), // Beautify

@fregante fregante May 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error thrown means finally isn't hit. That's why the message was not being updated at all

@fregante fregante marked this pull request as ready for review May 19, 2026 11:30
@fregante fregante merged commit 7ad72a0 into main May 20, 2026
10 checks passed
@fregante fregante deleted the copilot/fix-approve-now-fails branch May 20, 2026 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

quick-review - "Approve now" fails if there's a pending review

2 participants