Skip to content

Fix issues #123, #325, #326, #328: RPC timeout, test coverage, dead code removal - #334

Closed
presidojay1 wants to merge 4 commits into
conduit-protocol:mainfrom
presidojay1:fix/issues-123-325-326-328-final
Closed

Fix issues #123, #325, #326, #328: RPC timeout, test coverage, dead code removal#334
presidojay1 wants to merge 4 commits into
conduit-protocol:mainfrom
presidojay1:fix/issues-123-325-326-328-final

Conversation

@presidojay1

@presidojay1 presidojay1 commented Aug 26, 2026

Copy link
Copy Markdown

Summary

This PR addresses 4 GitHub issues with bug fixes, dead code removal, and comprehensive test coverage.

Changes

🐛 Issue #123: Token Selector infinite loading state

  • Added timeout handling to checkRecipientExists function in lib/soroban.ts
  • Set 10-second timeout for recipient validation in create page
  • Prevents infinite loading state when RPC provider times out
  • Added error logging for better debugging

🧹 Issue #328: Dead BatchStreamCreator code

  • Removed BatchStreamCreator.tsx which was never imported by any page
  • Removed its test file BatchStreamCreator.test.tsx
  • Component had non-functional submit handler that just displayed error message
  • Reduces dead weight and prevents confusion for future contributors

✅ Issue #326: Missing test coverage for Navbar and ConnectButton

Navbar.test.tsx (10 tests):

  • Mobile menu opening/closing on hamburger click
  • Menu closing on route change
  • Menu closing on Escape key press
  • iOS Safari backdrop click workaround (issue Mobile navigation menu doesn't close #143)
  • Keydown listener cleanup
  • aria-expanded attribute handling
  • ErrorBoundary integration

ConnectButton.test.tsx (11 tests):

  • 20s connect timeout safety net
  • Error message rendering from connect() rejection
  • Wallet connection/disconnection flow
  • Mount-guarded state updates
  • Timeout timer cleanup
  • Rapid connect state toggles

✅ Issue #325: Missing test coverage for WithdrawButton and StreamActions

WithdrawButton.test.tsx (17 tests):

  • Complete state machine: idle → signing → submitting → done/error
  • Mount-guarded state updates to prevent memory leaks
  • Error handling for wallet disconnection
  • Query invalidation after successful withdrawal
  • onSuccess callback execution
  • Dismiss and retry functionality
  • Protocol fee info display
  • Button disabled states during operations

StreamActions.test.tsx (20 tests):

  • Role-gated button rendering (sender vs recipient)
  • run() helper's pending/error handling
  • Top-up modal amount validation including MAX_I128 bound check
  • Pause, resume, cancel, clawback operations
  • Query invalidation after successful actions
  • Modal open/close functionality
  • Mount-guarded state updates
  • All button states for active/paused/ended streams

Testing

All new test files follow the existing testing patterns in the codebase using Vitest and React DOM testing.

Checklist

  • Bug fixes for RPC timeout issues
  • Removed dead code
  • Added comprehensive test coverage (58 new tests)
  • All commits follow conventional commit format
  • Changes are backward compatible
  • No breaking changes

Commits

  1. fix: add timeout handling to prevent infinite loading in recipient check
  2. refactor: remove dead BatchStreamCreator code
  3. test: add comprehensive test coverage for Navbar and ConnectButton
  4. test: add comprehensive test coverage for WithdrawButton and StreamActions

Closes #123
Closes #325
Closes #326
Closes #328

Fixes conduit-protocol#123

- Added timeout parameter to checkRecipientExists function in lib/soroban.ts
- Set 10-second timeout for recipient validation in create page
- Prevents infinite loading state when RPC provider times out
- Added error logging for better debugging
Fixes conduit-protocol#328

- Removed BatchStreamCreator.tsx which was never imported by any page
- Removed its test file BatchStreamCreator.test.tsx
- Component had non-functional submit handler that just displayed error
- Reduces dead weight and prevents confusion for future contributors
Fixes conduit-protocol#326

Navbar.test.tsx:
- Tests mobile menu opening/closing on hamburger click
- Tests menu closing on route change
- Tests menu closing on Escape key press
- Tests iOS Safari backdrop click workaround (issue conduit-protocol#143)
- Tests keydown listener cleanup
- Tests aria-expanded attribute
- Tests ErrorBoundary integration

ConnectButton.test.tsx:
- Tests 20s connect timeout safety net
- Tests error message rendering from connect() rejection
- Tests wallet connection/disconnection flow
- Tests mount-guarded state updates
- Tests timeout timer cleanup
- Tests rapid connect state toggles
…tions

Fixes conduit-protocol#325

WithdrawButton.test.tsx:
- Tests complete state machine: idle → signing → submitting → done/error
- Tests mount-guarded state updates to prevent memory leaks
- Tests error handling for wallet disconnection
- Tests query invalidation after successful withdrawal
- Tests onSuccess callback execution
- Tests dismiss and retry functionality
- Tests protocol fee info display
- Tests button disabled states during operations

StreamActions.test.tsx:
- Tests role-gated button rendering (sender vs recipient)
- Tests run() helper's pending/error handling
- Tests top-up modal amount validation including MAX_I128 bound check
- Tests pause, resume, cancel, clawback operations
- Tests query invalidation after successful actions
- Tests modal open/close functionality
- Tests mount-guarded state updates
- Tests all button states for active/paused/ended streams
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@presidojay1 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

@Jaydbrown

Copy link
Copy Markdown
Contributor

Thanks for the contribution here — squash-merging this now. Any follow-ups we'll track in a fresh issue. 🚀

@Jaydbrown

Copy link
Copy Markdown
Contributor

Every change in this PR — the BatchStreamCreator dead-code removal, the lib/soroban.ts checkRecipientExists timeout, the create-page recipient-check hardening, and the added component tests — has already landed on main via the overlapping sibling PRs #330, #331, #332, and #333. Rebasing this branch onto current main produces an empty diff, so there is nothing left to merge here. Closing as fully superseded — thanks for the work, @presidojay1, it's all in main. 🙏

@Jaydbrown Jaydbrown closed this Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants