Skip to content

Wrong network warning stays hidden when the app cannot read its own network #202

Description

@gabitoesmiapodo

Description

The dApp compares the wallet's synchronizers against the network wallet-service reports. When that second read fails, useWrongNetwork returns false, which the UI reads as "network is fine". The app stays quiet exactly when it knows nothing.

Steps to reproduce

  1. Start the stack with ./scripts/dev-stack.sh up
  2. Point the wallet at another network, such as devnet
  3. Open the dApp in the first few minutes, before the SV opens a mining round
  4. See no wrong-network banner

Expected vs actual behavior

Expected: the app warns, or says it cannot check.

Actual: the app shows nothing, and later writes fail with no explanation.

Additional context

fetchAppNetwork in dapp/frontend/src/backend/transferContext.ts reads the synchronizer id off the AmuletRules disclosure from amulet.tap. That call needs an open mining round, so it throws until the SV opens one. useWrongNetwork swallows the error on purpose.

Changes, all in dapp/frontend:

  • useWrongNetwork returns unknown, ok or wrong instead of a boolean
  • A failed read keeps the last successful verdict instead of blanking it
  • Poll every few seconds while unknown, settle to 30 seconds after the first answer
  • AppShell stops showing "No deployment" when the check has not answered
  • The app network is re-read rather than cached for the session, so a LocalNet reset cannot leave a stale value

This does not close the hole. The app can only learn its own network from wallet-service, and the only method that answers needs an open round. A complete fix needs a wallet-service method that reports the network without one, which is out of scope here. This issue narrows the window.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingpriority: lowNice to have, can wait

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions