-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Describe the bug
NDK assumes signing operations always succeed fast. EventSigner methods (sign,
encrypt, decrypt, encryptNip44, decryptNip44) have no error handling
throughout the codebase.
Signing can fail for multiple reasons:
- External signers (NIP-46, Amber, NIP-07): user refuses, bunker disconnected,
timeout - BIP340: invalid input data
When a signer fails, internal state (streams, BroadcastState, RequestState) is
not properly cleaned up.
Expected behavior
- Signer errors should be caught internally
- Streams and state properly closed on signing failure
- Exception re-thrown to caller after cleanup
Additional context
Exceptions that can be thrown:
SignerRequestRejectedException- user explicitly rejects the requestSignerRequestCancelledException- request cancelled by user- Generic
Exception- e.g., "Private key is required for signing"
Discovered while working on #398.
Reactions are currently unavailable