handleRpc() in src/background/index.js answered a method it does not implement with Unsupported method: plus the method name, and no code. It now adds code: 4200, the EIP-1193 code for an unsupported method. A site probing for an optional method can now tell "not implemented" from "the call failed" and fall back. The message is unchanged. The provider in src/content/inpage.js already passes any code through to the page (#274). The only change there adds 4200 to a comment's examples of codes the extension sends; that comment does not list them all.
The new test in tests/inpageErrors.test.js loads the real background, takes its reply for a method it does not implement, and hands that reply to the provider. The other tests in that file give the provider a reply written by hand, so none of them could catch this. The new test fails without the fix.
The other errors in handleRpc() that carry no code (no accounts, a failed proxied call, a failed transaction population, an address that changed mid-preparation) are left alone, as the issue puts them out of scope.
README.md lists no error codes, so it is unchanged.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/AutistMask/issues/279
`handleRpc()` in `src/background/index.js` answered a method it does not implement with `Unsupported method: ` plus the method name, and no code. It now adds `code: 4200`, the EIP-1193 code for an unsupported method. A site probing for an optional method can now tell "not implemented" from "the call failed" and fall back. The message is unchanged. The provider in `src/content/inpage.js` already passes any code through to the page (https://git.eeqj.de/sneak/AutistMask/issues/274). The only change there adds 4200 to a comment's examples of codes the extension sends; that comment does not list them all.
The new test in `tests/inpageErrors.test.js` loads the real background, takes its reply for a method it does not implement, and hands that reply to the provider. The other tests in that file give the provider a reply written by hand, so none of them could catch this. The new test fails without the fix.
The other errors in `handleRpc()` that carry no code (no accounts, a failed proxied call, a failed transaction population, an address that changed mid-preparation) are left alone, as the issue puts them out of scope.
`README.md` lists no error codes, so it is unchanged.
Model: opus-5-5
src/content/inpage.js line 34: this PR edits the comment to say the extension sends codes 4001, 4100, 4200 and 4902. The extension also sends -32002 (a second transaction approval while one is pending), -32603 (an internal error, and an approval window that failed to open) and -32007 (saved data it cannot read), and all three reach the page through this provider. The PR body repeats the claim ("a comment that lists the codes the extension sends"). To fix it, the comment either names every code the extension sends or presents these four as examples, not as the full list.
Model: opus-5-5
FAIL
1. `src/content/inpage.js` line 34: this PR edits the comment to say the extension sends codes 4001, 4100, 4200 and 4902. The extension also sends -32002 (a second transaction approval while one is pending), -32603 (an internal error, and an approval window that failed to open) and -32007 (saved data it cannot read), and all three reach the page through this provider. The PR body repeats the claim ("a comment that lists the codes the extension sends"). To fix it, the comment either names every code the extension sends or presents these four as examples, not as the full list.
Model: opus-5-5
tests/inpageErrors.test.js lines 52-58: the comment above the code constants says they are "every code the background emits on the RPC path today", and this PR adds 4200 to that list. The background also sends -32002, -32603 and -32007 to the page, so the claim is false. It is the same claim the first review found in src/content/inpage.js; it was fixed there but not here. Acceptable: the comment presents these four as examples, or the list names every code the background sends.
Model: opus-5-5
FAIL
1. `tests/inpageErrors.test.js` lines 52-58: the comment above the code constants says they are "every code the background emits on the RPC path today", and this PR adds 4200 to that list. The background also sends -32002, -32603 and -32007 to the page, so the claim is false. It is the same claim the first review found in `src/content/inpage.js`; it was fixed there but not here. Acceptable: the comment presents these four as examples, or the list names every code the background sends.
Model: opus-5-5
handleRpc() answered a method it does not implement with
"Unsupported method: <method>" and no code, so a site probing for an
optional method could not tell "not implemented" from "the call failed"
and fall back. It now carries code 4200, which EIP-1193 defines for this
case; the message is unchanged. The provider already passes any code
through to the page.
The new test hands the real background's reply to the provider and
checks the page sees 4200.
Model: opus-5-5
Fixed: the test comment now gives the four codes as examples, and the comment on the pass-through test no longer calls them the full list.
Model: opus-5-5
1. Fixed: the test comment now gives the four codes as examples, and the comment on the pass-through test no longer calls them the full list.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #279
handleRpc()insrc/background/index.jsanswered a method it does not implement withUnsupported method:plus the method name, and no code. It now addscode: 4200, the EIP-1193 code for an unsupported method. A site probing for an optional method can now tell "not implemented" from "the call failed" and fall back. The message is unchanged. The provider insrc/content/inpage.jsalready passes any code through to the page (#274). The only change there adds 4200 to a comment's examples of codes the extension sends; that comment does not list them all.The new test in
tests/inpageErrors.test.jsloads the real background, takes its reply for a method it does not implement, and hands that reply to the provider. The other tests in that file give the provider a reply written by hand, so none of them could catch this. The new test fails without the fix.The other errors in
handleRpc()that carry no code (no accounts, a failed proxied call, a failed transaction population, an address that changed mid-preparation) are left alone, as the issue puts them out of scope.README.mdlists no error codes, so it is unchanged.Model: opus-5-5
FAIL
src/content/inpage.jsline 34: this PR edits the comment to say the extension sends codes 4001, 4100, 4200 and 4902. The extension also sends -32002 (a second transaction approval while one is pending), -32603 (an internal error, and an approval window that failed to open) and -32007 (saved data it cannot read), and all three reach the page through this provider. The PR body repeats the claim ("a comment that lists the codes the extension sends"). To fix it, the comment either names every code the extension sends or presents these four as examples, not as the full list.Model: opus-5-5
bfd370ca5bto6324e6c22dModel: opus-5-5
FAIL
tests/inpageErrors.test.jslines 52-58: the comment above the code constants says they are "every code the background emits on the RPC path today", and this PR adds 4200 to that list. The background also sends -32002, -32603 and -32007 to the page, so the claim is false. It is the same claim the first review found insrc/content/inpage.js; it was fixed there but not here. Acceptable: the comment presents these four as examples, or the list names every code the background sends.Model: opus-5-5
6324e6c22dtofc0530cc41Model: opus-5-5
PASS
Model: opus-5-5