Skip to content

Fix: Correct Response Handling in ClientSend#404

Merged
GODrums merged 2 commits into
masterfrom
fix/uncaught-promise-error
Jun 15, 2026
Merged

Fix: Correct Response Handling in ClientSend#404
GODrums merged 2 commits into
masterfrom
fix/uncaught-promise-error

Conversation

@GODrums

@GODrums GODrums commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Bug

Most of our enhanced pages currently print these errors: image

EmptyResponseHandler returns void after successful execution, causing ClientSend to reject the promise.
Addresses errors mentioned in #402 as well

Fix

Only reject on error, otherwise resolve with undefined. Functionality unchanged, just gets rid of an incorrect rejection.


< />!NOTE< />
Low Risk
Single-branch change in bridge client response handling; aligns with how the background already sends success vs error bundles.

Overview
Fixes incorrect promise rejection in ClientSend when talking to the background worker via runtime.sendMessage.

The callback now rejects only when resp.error is set and resolves with resp.response otherwise (including undefined). Previously, a missing/falsy response was treated as failure, so handlers like EmptyResponseHandler that complete successfully with no payload caused spurious rejections and console errors on enhanced pages.

Reviewed by Cursor Bugbot for commit 712400b. Configure here.

@GODrums GODrums requested a review from Step7750 June 15, 2026 01:32
@GODrums GODrums self-assigned this Jun 15, 2026
@GODrums GODrums added the bug label Jun 15, 2026
@GODrums GODrums merged commit d46eac3 into master Jun 15, 2026
2 checks passed
@GODrums GODrums deleted the fix/uncaught-promise-error branch June 15, 2026 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants