rainbowkit icon indicating copy to clipboard operation
rainbowkit copied to clipboard

[bug] "Setting the value of rk-transactions exceeded the quota error" using useAddRecentTransaction

Open jackmellis opened this issue 3 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

RainbowKit Version

0.3.4

wagmi Version

0.4.12

Current Behavior

Hi.

When we trigger a transaction in our app we're calling rainbowkit's addRecentTransaction method. After adding a particular transaction, we got an app-crashing error (see stack trace below) and now I see this error as soon as I load the app.

Stack trace:

chunk-S7EOD33A.js?ddac:573 Uncaught DOMException: Failed to execute 'setItem' on 'Storage': Setting the value of 'rk-transactions' exceeded the quota.
    at persistData (webpack-internal:///./node_modules/@rainbow-me/rainbowkit/dist/chunk-S7EOD33A.js:586:18)
    at updateTransactions (webpack-internal:///./node_modules/@rainbow-me/rainbowkit/dist/chunk-S7EOD33A.js:581:5)
    at Object.addTransaction (webpack-internal:///./node_modules/@rainbow-me/rainbowkit/dist/chunk-S7EOD33A.js:534:5)
    at eval (webpack-internal:///./node_modules/@rainbow-me/rainbowkit/dist/index.js:605:11)
    at eval (webpack-internal:///./src/contexts/nftx.tsx:25:9)
    at eval (webpack-internal:///./node_modules/@nftx/react/dist/es/react.js:139:9)

Assuming the rk-transactions local storage variable is linked to this so I'm pasting that as well:

{"0x6ce798Bc8C8C93F3C312644DcbdD2ad6698622C5":{"1":[{"hash":"0x2069c650bfeed13a41495a7f1a430267ff712d43877f86f3dbd585c232a07bf0","description":"Stake Liquidity","status":"confirmed"},{"hash":"0x705d4d472b017c838a98512bc0a8c842122d2ffd9e17762e72251c3d7c83c01e","description":"Stake SLP","status":"confirmed"},{"hash":"0xa8950621a823c05a0d87c706654ac5e303964412af53d5cc9f7e408ada7462fa","description":"Stake SLP","status":"confirmed"},{"hash":"0x46b7b8d1ee26cb1df5e397c5b085bc1ce5fd04b45e625c32bfb2bfdd6f351b70","description":"Approve","status":"confirmed"},{"hash":"0x5d06dee69a3026f852a29ca5ddafe34a04b38dabacecb2258a279345adc3567f","description":"Approve","status":"confirmed"},{"hash":"0x08c71976aae636f42f85a2df001200ebac73b759fda5da0da6806642a76de277","description":"Approve","status":"confirmed"},{"hash":"0x184ca0477ab327125c6750cb300f582d8e7c84694a7d1c704d90ebc3b0addb58","description":"","status":"confirmed"},{"hash":"0xf4664f7c749a58159b5d9343af66e89bbdb5de71aa43f92564c58e6dd60274da","description":"Approve","status":"confirmed"},{"hash":"0xcd28f9c1c60d2f847b02ff6c45659c61155cb5c4a0befa3b4ad1056b432b59d2","description":"Approve","status":"confirmed"},{"hash":"0x4315bde7cc8a127777af2a85ca87e21c90365df85f0f2759670f447de0155101","description":"","status":"confirmed"},{"hash":"0xcd429c2d02bc649039b7ee3f7a08a2363812d7d1980221225dc6ce89e9c5e55c","description":"","status":"confirmed"}]},"0x2eB750A8AF6551165241fCf39ca177651D477777":{"1":[{"hash":"0xd9b863a084917651ef85544728bd914cd2a43985dd6b433a1bb23934316e61cc","description":"Approve","status":"pending"}]}}

When I deleted this variable the page loaded fine. Although weirdly when I re-added it, the error didn't return...

Expected Behavior

Until now this was working fine. Transactions were being added to the rainbowkit modal as expected.

Steps To Reproduce

Seems to be intermittent. After I deleted the local storage value I haven't been able to replicate it...

Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)

No response

Anything else?

I should mention this happened on localhost

jackmellis avatar Jul 08 '22 10:07 jackmellis

The quota for local storage should be more than enough for RainbowKit since we clean up completed transactions if there are more than 10. Since you said it's intermittent, I wonder if this is because you're running another app on localhost that uses more space?

markdalgleish avatar Jul 14 '22 06:07 markdalgleish

This issue has been temporarily closed due to the lack of a minimal reproducible example. Please upload a minimal reproducible example (you can use this template) and then we will reopen this issue. :)

jxom avatar Sep 07 '22 23:09 jxom