@dynamic-labs-wallet/browser-wallet-client 0.0.345 → 0.0.347

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -811,7 +811,29 @@ class IframeManager {
811
811
  if (!this.iframeMessageHandler) {
812
812
  throw new Error('Iframe message handler not initialized');
813
813
  }
814
- await this.iframeMessageHandler.cleanup();
814
+ // The iframe-side cleanup handler clears localStorage + secureStorage
815
+ // (initWaasWalletHandler.ts), which is best-effort: if it doesn't ACK
816
+ // within the request channel's 5s timeout, the channel rejects with a
817
+ // (misleadingly named) NO_HANDLERS_REGISTERED error. Pre-#1063 that
818
+ // rejection was masked because recoverIframe rebuilt the iframe and
819
+ // the retry hit a fresh handler; post-#1063 we keep the (slow) alive
820
+ // iframe, the rejection surfaces, and — uncaught here — becomes an
821
+ // unhandled promise rejection / pageerror. RN-web's secureStorage is
822
+ // slow enough to trigger this routinely, breaking the
823
+ // `sign-message-new-wallet` re-login flow.
824
+ //
825
+ // Swallow the error: we're about to remove the iframe from the DOM
826
+ // (or another instance is, when iframeInstanceCount drops to 0),
827
+ // which obsoletes anything the cleanup handler would have cleared.
828
+ // Stale storage from a missed cleanup is cleared by the next iframe
829
+ // init's __resetInitializationState anyway.
830
+ try {
831
+ await this.iframeMessageHandler.cleanup();
832
+ } catch (error) {
833
+ this.logger.warn('(cleanup) iframeMessageHandler.cleanup() failed; proceeding with DOM teardown', {
834
+ error: error instanceof Error ? error.message : error
835
+ });
836
+ }
815
837
  if (this.iframe) {
816
838
  IframeManager.iframeInstanceCount--;
817
839
  if (IframeManager.sharedIframe && IframeManager.iframeInstanceCount === 0) {
package/index.esm.js CHANGED
@@ -810,7 +810,29 @@ class IframeManager {
810
810
  if (!this.iframeMessageHandler) {
811
811
  throw new Error('Iframe message handler not initialized');
812
812
  }
813
- await this.iframeMessageHandler.cleanup();
813
+ // The iframe-side cleanup handler clears localStorage + secureStorage
814
+ // (initWaasWalletHandler.ts), which is best-effort: if it doesn't ACK
815
+ // within the request channel's 5s timeout, the channel rejects with a
816
+ // (misleadingly named) NO_HANDLERS_REGISTERED error. Pre-#1063 that
817
+ // rejection was masked because recoverIframe rebuilt the iframe and
818
+ // the retry hit a fresh handler; post-#1063 we keep the (slow) alive
819
+ // iframe, the rejection surfaces, and — uncaught here — becomes an
820
+ // unhandled promise rejection / pageerror. RN-web's secureStorage is
821
+ // slow enough to trigger this routinely, breaking the
822
+ // `sign-message-new-wallet` re-login flow.
823
+ //
824
+ // Swallow the error: we're about to remove the iframe from the DOM
825
+ // (or another instance is, when iframeInstanceCount drops to 0),
826
+ // which obsoletes anything the cleanup handler would have cleared.
827
+ // Stale storage from a missed cleanup is cleared by the next iframe
828
+ // init's __resetInitializationState anyway.
829
+ try {
830
+ await this.iframeMessageHandler.cleanup();
831
+ } catch (error) {
832
+ this.logger.warn('(cleanup) iframeMessageHandler.cleanup() failed; proceeding with DOM teardown', {
833
+ error: error instanceof Error ? error.message : error
834
+ });
835
+ }
814
836
  if (this.iframe) {
815
837
  IframeManager.iframeInstanceCount--;
816
838
  if (IframeManager.sharedIframe && IframeManager.iframeInstanceCount === 0) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/browser-wallet-client",
3
- "version": "0.0.345",
3
+ "version": "0.0.347",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/core": "0.0.345",
7
+ "@dynamic-labs-wallet/core": "0.0.347",
8
8
  "@dynamic-labs/logger": "^4.45.2",
9
9
  "@dynamic-labs/message-transport": "^4.45.2"
10
10
  },
@@ -1 +1 @@
1
- {"version":3,"file":"IframeManager.d.ts","sourceRoot":"","sources":["../../../src/client/iframeManager/IframeManager.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOR,KAAK,qBAAqB,EAE1B,KAAK,oBAAoB,EAE1B,MAAM,2BAA2B,CAAC;AACn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