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

Wallet on connection error: "Failed to publish payload, please try again." #4337

Open
kvnschlndt opened this issue Mar 16, 2024 · 11 comments
Open
Labels
type: bug Something isn't working

Comments

@kvnschlndt
Copy link

kvnschlndt commented Mar 16, 2024

Describe the bug
On the connection of the wallet this unhandled error is thrown.
Some connections are working some are not.

What is the reason? How to avoid this?

Expected behavior
No unhandled error thrown

Screenshots
image

@kvnschlndt kvnschlndt added the type: bug Something isn't working label Mar 16, 2024
@ganchoradkov
Copy link
Member

hey @kvnschlndt thank you for the report.
Please update to latest (currently 2.11.3) and try again.
We've optimized the publish behaviour and should be much more robust especially in slow network conditions

@kvnschlndt
Copy link
Author

@ganchoradkov after the update we can see a slightly better performance.
Actually time by time we get still the "failed to publish" error.

And also we now get notifications about possible memory leaks:
image

Also it tries to reach the the relayer socket, but the wallet is disconnected from the dApp:
image

@ganchoradkov
Copy link
Member

ganchoradkov commented Mar 21, 2024

Hey thanks for the response! Do you have any VPNs running while experiencing the issues?
Socket stalled happens when the websocket fails to emit onopen event for a whole minute meaning there is definitely something preventing the SDK from reaching the relay.

About the event leak, do you have steps to reproduce? Just leaving the app open for a while?

@glitch-txs
Copy link
Member

And also we now get notifications about possible memory leaks:

Seems like you are subscribing to the "disconnect" event more than once, could be a loop or something.

@kvnschlndt
Copy link
Author

Hey, to better understand our use case:
We have an api service which acts as a wallet for testing purposes. The api can handle 40 connections at the same time.
There is no VPN used.
If this websocket error occurs we can still connect new wallets and they can connect to the relay.
The only thing that has been changed was the update from 2.10.1 -> 2.11.3

The memory leak appears when a lot of wallets are connected.
We will switch back to the previous version and compare the performance and errors.

@ganchoradkov
Copy link
Member

Thank you for the overview, it seems like it might be a case of improper cleanup of failed connection attempts

If this websocket error occurs we can still connect new wallets and they can connect to the relay.

this means there is an active connection and the error is logged by a past attempt

@kvnschlndt
Copy link
Author

So comparing the two versions:
With 2.10.1 we don´t have the web socket problems + no memory leak notifications.
Tho "failed to publish" appears more often.

@kvnschlndt
Copy link
Author

kvnschlndt commented Apr 15, 2024

@ganchoradkov do you have any news?
Its pretty unusable in this state.

image

Still seeing this web socket problems, tho network connection is perfectly good. Is it possible that we are getting blocked because of producing to much requests?
20+ connections can be maintained at the same time.

Updated in the meantime to: 2.12.2

@ganchoradkov
Copy link
Member

Hey @kvnschlndt unfortunately I don't have yet any conrete tips at the moment.

Is it possible that we are getting blocked because of producing to much requests?

this shouldn't be the case unless you're sending +10 messages per second

@kvnschlndt
Copy link
Author

@ganchoradkov
+10 message is unlikely but logically it can happen and it might happen, is it such an error we could see then or would it be a different error?

@kvnschlndt
Copy link
Author

kvnschlndt commented Apr 17, 2024

@ganchoradkov do you plan to fix the issue?
It can be easily reproduced by turning off internet connection, waiting for the first error message, then turning on again.
The error then is spammed in the console.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants