Skip to content

fix: prevent nostr: prefix on bech32 IDs inside URLs and improve relay errors#229

Merged
barrydeen merged 1 commit intomainfrom
fix/bech32-url-prefix-and-relay-errors
Mar 12, 2026
Merged

fix: prevent nostr: prefix on bech32 IDs inside URLs and improve relay errors#229
barrydeen merged 1 commit intomainfrom
fix/bech32-url-prefix-and-relay-errors

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Fix bare bech32 auto-prefix regex incorrectly matching npub1/note1/nevent1/nprofile1 strings embedded in URLs (e.g. blossom band hostnames like npub1xxx.blossom.band), which caused published content to contain mangled URLs like https://nostr:npub1xxx.blossom.band/...
  • Use exception class name instead of generic "Unknown error" for relay connection failures
  • Suppress relay connection error console logs when app is backgrounded

Test plan

  • Compose a note containing a blossom URL with an npub in the hostname and verify the URL is not modified on publish
  • Paste a bare npub/note ID and verify it still gets auto-prefixed with nostr:
  • Verify relay connection errors show the actual exception type instead of "Unknown error"
  • Background the app and verify relay errors don't flood the console log

…y error messages

Stop the bare bech32 auto-prefix regex from matching npub/note/nevent/nprofile
strings embedded in URLs (e.g. blossom band hostnames) by excluding /.:#
as preceding characters. Also use exception class name instead of "Unknown error"
for relay failures and suppress connection error logs when app is backgrounded.
@barrydeen barrydeen merged commit ae89c50 into main Mar 12, 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

Development

Successfully merging this pull request may close these issues.

1 participant