The Nostr profile editor only handled display_name/displayName on read and wrote just display_name on save (deleting displayName), so profiles that use name or the deprecated aliases were displayed and updated incorrectly.
This reads the first present of display_name, displayName, name and username (NIP-01/NIP-24 priority) with a fallback to the account display name, and writes the edited value to every variant for maximum client compatibility. The ordered key list is defined once in NostrManagerService::DISPLAY_NAME_KEYS and passed to the Stimulus controller, so the Ruby and JS sides can't drift.
Changes:
NostrManagerService::DISPLAY_NAME_KEYS constant.
Read-side fallback chain in NostrEditProfileComponent.
Write-side loop over all keys in nostr_profile_editor_controller.js.
Component spec coverage for the fallback chain.
Documentation note in docs/dev/nostr.md.
No server-side merge is involved: the browser builds the kind 0 content JSON and the controller accepts it as-is.
Tested with spec/components/settings/nostr_edit_profile_component_spec.rb (16 examples, 0 failures).
The Nostr profile editor only handled `display_name`/`displayName` on read and wrote just `display_name` on save (deleting `displayName`), so profiles that use `name` or the deprecated aliases were displayed and updated incorrectly.
This reads the first present of `display_name`, `displayName`, `name` and `username` (NIP-01/NIP-24 priority) with a fallback to the account display name, and writes the edited value to every variant for maximum client compatibility. The ordered key list is defined once in `NostrManagerService::DISPLAY_NAME_KEYS` and passed to the Stimulus controller, so the Ruby and JS sides can't drift.
Changes:
- `NostrManagerService::DISPLAY_NAME_KEYS` constant.
- Read-side fallback chain in `NostrEditProfileComponent`.
- Write-side loop over all keys in `nostr_profile_editor_controller.js`.
- Component spec coverage for the fallback chain.
- Documentation note in `docs/dev/nostr.md`.
No server-side merge is involved: the browser builds the kind 0 content JSON and the controller accepts it as-is.
Tested with `spec/components/settings/nostr_edit_profile_component_spec.rb` (16 examples, 0 failures).
The editor read only `display_name`/`displayName` and wrote just `display_name` (deleting `displayName`), so profiles using `name` or the deprecated aliases were shown and updated incorrectly.
Read the first present of `display_name`, `displayName`, `name` and `username` (NIP-01/NIP-24 priority) with a fallback to the account display name, and write the edited value to every variant. The key list lives in `NostrManagerService::DISPLAY_NAME_KEYS` and is passed to the Stimulus controller so Ruby and JS stay in sync.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The Nostr profile editor only handled
display_name/displayNameon read and wrote justdisplay_nameon save (deletingdisplayName), so profiles that usenameor the deprecated aliases were displayed and updated incorrectly.This reads the first present of
display_name,displayName,nameandusername(NIP-01/NIP-24 priority) with a fallback to the account display name, and writes the edited value to every variant for maximum client compatibility. The ordered key list is defined once inNostrManagerService::DISPLAY_NAME_KEYSand passed to the Stimulus controller, so the Ruby and JS sides can't drift.Changes:
NostrManagerService::DISPLAY_NAME_KEYSconstant.NostrEditProfileComponent.nostr_profile_editor_controller.js.docs/dev/nostr.md.No server-side merge is involved: the browser builds the kind 0 content JSON and the controller accepts it as-is.
Tested with
spec/components/settings/nostr_edit_profile_component_spec.rb(16 examples, 0 failures).