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

AutoConnect fails frequently during development #193

Open
not-reed opened this issue May 22, 2024 · 0 comments
Open

AutoConnect fails frequently during development #193

not-reed opened this issue May 22, 2024 · 0 comments

Comments

@not-reed
Copy link

image

https://github.com/alephium/extension-wallet/blob/f21129975ff249dde184a12e952583af143798b9/packages/extension/src/inpage/alephiumWindowObject.ts#L337C6-L337C21

document.onFocus() is false for a variety of reasons in dev, meaning I am getting Error: Unsolicited request errors frequently.

Most common reasion is that I have hot reloading setup so every time I save my source code files the browser reloads automatically causing autoConnect to fail as the document isn't in focus during the reload.

Another common case I come across is if my dev tools are open, and I press F5 or Ctrl+R to refresh the page, since the dev tools are focused, document.onFocus() is again false and autoConnect fails.

Maybe replacing with document.hidden from the Page Visibility API is acceptible? or relaxing the conditions for autoconnect (possibly just on localhost?)

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

No branches or pull requests

1 participant