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

[bug]: Should detect switching accounts in MM, and reinitialize app #188

Closed
Tracked by #202
autonome opened this issue Apr 11, 2024 · 3 comments
Closed
Tracked by #202
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@autonome
Copy link

Describe the bug

If I connect to the app with an account, and then in MM switch accounts, the app should reinitialize itself instead of leaving previous-connected account up.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to an account
  2. Open MM
  3. Switch to a different account

Expected behavior

The app reinitializes, shows the 'connect' button.

Actual behavior

The app does not change, still shows information of previously connected account.

@autonome autonome added bug Something isn't working help wanted Extra attention is needed labels Apr 11, 2024
@hugomrdias
Copy link
Collaborator

Do you mean native or FEVM ?
Native account are not connected to MM account, it might be a good idea to do that.
FEVM changes when you change account on MM you just need to connect the new account manually

@autonome
Copy link
Author

autonome commented Jun 14, 2024

I did a round of manual testing today and the demo app behaves differently for different combinations of the flow, and also depending if directly after connecting or not.

So I guess fixing this issue would require first to determine whether it's worth shaking out bugs in the demo app, or whether some of this should go in a higher-level library or helper.

Eg, to do this properly, I'd make a matrix of the combinations of the following and have a test which exercises the complete set of valid combinations:

  • different networks
  • different accounts
  • just-connected/already-connected/disconnected

But before writing the test, I bet writing out that matrix would inform whether some API/event/library change might solve the problem better for dapp authors, instead of leaving everything as-is and writing tests for what might be a bucket of footguns.

@hugomrdias
Copy link
Collaborator

  • complete reworked the app to be in sync with the provider (MM and filsnap also stay in sync)
  • reconnect on mount is supported now
  • MM and filsnap disconnect properly
  • Chains are properly added if missing and changed in sync on MM and filsnap

check out https://filsnap.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants