Skip to content

fix(wallets): handle deep link connection timeout in LobstrAdapter (#770) - #800

Merged
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
therealbibson:feat/issue-770-lobstr-connection-timeout
Aug 31, 2026
Merged

fix(wallets): handle deep link connection timeout in LobstrAdapter (#770)#800
Kingsman-99 merged 2 commits into
Stellar-split:mainfrom
therealbibson:feat/issue-770-lobstr-connection-timeout

Conversation

@therealbibson

Copy link
Copy Markdown
Contributor

Overview

Adds configurable connection timeout handling to LobstrAdapter so pending promises do not hang indefinitely when deep links or extension connection requests are ignored or unresponsive, rejecting with WalletConnectionTimeoutError and ensuring timer cleanup.

Related Issue

Closes #770

Changes

Wallet Adapters

  • [MODIFY] src/wallets/adapters/LobstrAdapter.ts
    • Added LobstrAdapterOptions supporting configurable connectionTimeoutMs (default 60000)
    • Handled connection timeout using Promise.race and setTimeout/clearTimeout
    • Cleans up listeners on disconnect and timeout
  • [MODIFY] src/errors.ts
    • Defined WalletConnectionTimeoutError and isWalletConnectionTimeoutError type guard
  • [MODIFY] src/index.ts
    • Exported WalletConnectionTimeoutError, isWalletConnectionTimeoutError, LobstrAdapter, and LobstrAdapterOptions
  • [MODIFY] test/walletSessionManager.test.ts
    • Added unit tests verifying default and custom timeout configuration, timeout rejections with WalletConnectionTimeoutError, timer cleanup on success/rejection, and disconnect() cleanup
  • [MODIFY] test/sdkExports.test.ts
    • Added assertions verifying public exports for LobstrAdapter and WalletConnectionTimeoutError

Verification Results

 RUN  v1.6.1 /Users/user/Documents/Projects/open_source/split-sdk

 ✓ test/walletSessionManager.test.ts  (26 tests) 11ms
 ✓ test/sdkExports.test.ts  (3 tests) 2ms

 Test Files  2 passed (2)
      Tests  29 passed (29)
Acceptance Criteria Status
The adapter waits at most connectionTimeoutMs (default 60 000, configurable) for a deep link response ✅ Default connectionTimeoutMs (60,000ms) with custom configuration supported
After the timeout, the pending promise rejects with a WalletConnectionTimeoutError ✅ Pending connection rejects with typed WalletConnectionTimeoutError
The deep link listener is cleaned up on timeout ✅ Timer and event listeners cleaned up appropriately
Unit tests pass ✅ All 29 unit tests pass

@drips-wave

drips-wave Bot commented Aug 31, 2026

Copy link
Copy Markdown

@therealbibson Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Kingsman-99
Kingsman-99 merged commit 83f8b9d into Stellar-split:main Aug 31, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

Handle deep link connection timeout in LobstrAdapter

2 participants