fix: properly handle async NostrSend calls for Kind 21002 responses #1

Merged
padreug merged 2 commits from feature/nostr-send-async into dev 2026-01-25 19:39:55 +00:00

2 commits

Author SHA1 Message Date
Patrick Mulligan
748a2d3ed6 fix(handlers): await NostrSend calls throughout codebase
Some checks failed
Docker Compose Actions Workflow / test (push) Has been cancelled
Update all NostrSend call sites to properly handle the async nature
of the function now that it returns Promise<void>.

Changes:
- handler.ts: Add async to sendResponse, await nostrSend calls
- debitManager.ts: Add logging for Kind 21002 response sending
- nostrMiddleware.ts: Update nostrSend signature
- tlvFilesStorageProcessor.ts: Update nostrSend signature
- webRTC/index.ts: Add async/await for nostrSend calls

This ensures Kind 21002 (ndebit) responses are properly sent to
wallet clients, fixing the "Debit request failed" issue in ShockWallet.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:38:24 -05:00
Patrick Mulligan
30d818c4d4 fix(nostr): update NostrSend type to Promise<void> with error handling
The NostrSend type was incorrectly typed as returning void when it actually
returns Promise<void>. This caused async errors to be silently swallowed.

Changes:
- Update NostrSend type signature to return Promise<void>
- Make NostrSender._nostrSend default to async function
- Add .catch() error handling in NostrSender.Send() to log failures
- Add logging to track event publishing status

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 14:37:56 -05:00