Avoid duplicate site entries in Nostr list editors #271

Merged
raucao merged 1 commits from bugfix/nostr_relay_list_editing into master 2026-11-19 11:51:26 +00:00
Owner

The relay and media server editors compared the configured site URL against the entries in the user's existing event with raw string equality. A trailing slash or a different case therefore made the site entry look missing, so it was prepended again as a duplicate "added" row — even though the status component reported it as already part of the list.

This compares with NostrManagerService.normalize_url instead (stripping surrounding whitespace, a trailing slash and case), matching what the status components and the JS list editor already do. It also adds the missing is_a?(Array) guard on the relay tag selection.

The stored URL is left untouched; only the comparison is normalized, so published events are not silently rewritten.

Fixes the duplicate wss://nostr.kosmos.org entry when the relay is already present as wss://nostr.kosmos.org/.

The relay and media server editors compared the configured site URL against the entries in the user's existing event with raw string equality. A trailing slash or a different case therefore made the site entry look missing, so it was prepended again as a duplicate "added" row — even though the status component reported it as already part of the list. This compares with `NostrManagerService.normalize_url` instead (stripping surrounding whitespace, a trailing slash and case), matching what the status components and the JS list editor already do. It also adds the missing `is_a?(Array)` guard on the relay tag selection. The stored URL is left untouched; only the comparison is normalized, so published events are not silently rewritten. Fixes the duplicate `wss://nostr.kosmos.org` entry when the relay is already present as `wss://nostr.kosmos.org/`.
raucao added 1 commit 2026-11-19 11:48:10 +00:00
Avoid duplicate site entries in Nostr list editors
CI / Test (pull_request) Successful in 45s
Release Drafter / Update release notes draft (pull_request) Successful in 2s
2a19aecf3e
The relay and media server editors compared the configured site URL
against existing event entries with raw string equality, so a trailing
slash or different case made the site entry look missing and it was
prepended again as a duplicate "added" row. Compare with
NostrManagerService.normalize_url instead, matching the status
components and the JS list editor.
raucao added the bugkredits-1
integration
nostr
labels 2026-11-19 11:50:57 +00:00
raucao merged commit b6320b80f6 into master 2026-11-19 11:51:26 +00:00
raucao deleted branch bugfix/nostr_relay_list_editing 2026-11-19 11:51:27 +00:00
Sign in to join this conversation.