Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User rejected request #557

Open
dhruv035 opened this issue Jan 23, 2025 · 7 comments
Open

User rejected request #557

dhruv035 opened this issue Jan 23, 2025 · 7 comments
Labels

Comments

@dhruv035
Copy link

The wallet connection seems to break after transaction and the starknet context doesn't seem to know this. I have my UI unchanged but after a transaction the wallet get's locked sometimes resulting in a user rejected request on the next interaction

@apibara apibara deleted a comment Jan 24, 2025
@fracek fracek added the bug label Jan 24, 2025
@fracek
Copy link
Contributor

fracek commented Jan 24, 2025

Will look into this. Does the demo app on the website also break in the same way?

@dhruv035
Copy link
Author

dhruv035 commented Jan 24, 2025

It does, Im looking at this and after sending transaction and switching tabs after sometime if I try to send tx again it says user rejected request. Im using argent wallet for this

Image

As you can see above my wallet shows connected but the connector connection is broken and is failing when executing the call

@fracek
Copy link
Contributor

fracek commented Jan 24, 2025

I investigated the issue and it's because the wallet becomes locked and it automatically rejects the request. The hook correctly sends the wallet_addInvokeTransaction request and IMHO it's up to the wallet to decide whether to show an unlock UI or automatically reject the request. There is nothing the library can do to work around this.

@dhruv035
Copy link
Author

dhruv035 commented Jan 24, 2025

but Im not clear as to why the lock happens, my wallet settings suggest the lock should happen on a idle time of 30 mins, whereas this happened in less than 5 (sometimes as quick as 30 seconds), something seems to trigger a wallet lock which Im not able to figure out. We are not having this issue on a v2 rolled back version of the library so I think something in v3 is causing the wallet to get locked.

@fracek
Copy link
Contributor

fracek commented Jan 25, 2025

Maybe v2 was polling the wallet (it was a lot less efficient in wallet calls) enough to avoid the wallet locking? While now the library won't make any wallet call unless prompted by the user.

@dhruv035
Copy link
Author

dhruv035 commented Jan 27, 2025

Yeah I noticed that, I will investigate this further and report here, is there a switch tab/out of focus interaction that is detected by the library cuz I think the issue might lie there, but I do think there's some issues with argent itself since the locking issue doesnt happen on braavos, though the refreshes are still slower on there. Is there a finality setting in the library which might be causing it to wait before sending an update? (I have a tx pending based button disabler but after the transaction is detected as successful it takes sometime (almost 1 block later) for the read contract states to catchup)

@fracek
Copy link
Contributor

fracek commented Jan 27, 2025

I believe by default react-query (which the library uses under the hood) pauses requests while the tab is in the background. You should also check and change the contract read blockIdentifier to the pending block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants