Repository navigation
fix(flutter): show 'wallet connector could not load' instead of 'install Freighter' when the Freighter bridge fails to load - #148
Merged
Conversation
…a missing Freighter The Freighter bridge imports @stellar/freighter-api from a CDN (esm.sh). When that import fails (offline, blocked CDN, ad blocker, network filter), index.html swallowed the error and connecting reported "Freighter not found, install the extension", even with Freighter installed. - index.html sets window.puls3FreighterBridgeFailed when the bridge import fails. - The web bridge reads it: a missing bridge after a failed load is the new WalletConnectorUnavailable; with no flag it stays WalletNotInstalled. - Wallet panel: "Could not load the wallet connector" with the reason (connection or ad blocker, then reload) and Try again, no Install button. Hire flow and deploy flow map it too. The root fix, bundling the Freighter API locally behind a CSP, stays in #116. Refs #116
7 tasks
Deploying puls3 with
|
| Latest commit: |
298648a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://aae4060f.puls3-4lw.pages.dev |
| Branch Preview URL: | https://fix-116-freighter-bridge-una.puls3-4lw.pages.dev |
5 tasks
TOMOKI977
approved these changes
Oct 11, 2026
TOMOKI977
left a comment
Contributor
There was a problem hiding this comment.
Approved. The bridge-load failure is now distinguished from a missing Freighter installation, and the regression coverage matches that behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #116
Summary
The Freighter bridge (
web/freighter_bridge.js) imports@stellar/freighter-apifrom a CDN (esm.sh). When that import fails,web/index.htmlswallowed the error, and connecting showed "Freighter not found, install the extension", even to a user who has Freighter installed. The import fails when the user is offline, the CDN is blocked or down, or an ad blocker or network filter stops it. The user was then sent to reinstall a wallet they already have.This PR tells the two cases apart. The root fix, bundling the Freighter API locally behind a CSP, stays in #116.
web/index.htmlsetswindow.puls3FreighterBridgeFailed = truewhen the bridge import fails. It still logs the error as before.The web bridge (
freighter_bridge_web.dart) reads that flag when the bridge functions are missing:WalletConnectorUnavailable;WalletNotInstalled, as before.The decision is the pure function
bridgeMissingError, so it can be unit tested without a browser.Messages:
Acceptance criteria
This PR does not close #116. Its criteria (bundle the API, add a CSP) are untouched.
WalletExceptionhandles the new case. It is a sealed class, so the analyzer enforces this.Verification evidence
New tests:
test/wallet/bridge_missing_error_test.dart:WalletConnectorUnavailable;WalletNotInstalled;test/wallet/wallet_connection_test.dart: the panel shows the connector state with Try again and no Install Freighter button.To check it by hand in Chrome with Freighter installed:
esm.shin DevTools → Network request blocking.Notes for reviewers
FreighterWallet.signTransactionwould also refuse a SEP-10 challenge as it is:_assertSourceBindingrequires the transaction source to be the connected account, but in SEP-10 the source is the server's signing key.