Skip to content

fix: refuse an ambiguous nickname instead of picking the first peer - #1689

Open
Chessing234 wants to merge 1 commit into
permissionlesstech:mainfrom
Chessing234:fix/refuse-ambiguous-nickname
Open

fix: refuse an ambiguous nickname instead of picking the first peer#1689
Chessing234 wants to merge 1 commit into
permissionlesstech:mainfrom
Chessing234:fix/refuse-ambiguous-nickname

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • UnifiedPeerService.getPeerID(for:) and geohash geoNicknames.first(where:) returned the first match, so /msg and /block could hit the wrong person when two peers shared a nickname.
  • An unsuffixed name is accepted only when it identifies exactly one peer. Colliding names need the people-list #xxxx suffix.

Test plan

  • swiftc typecheck of NicknameLookup.swift under Swift 5 and 6
  • local harness against NicknameLookup (unique, colliding, #xxxx suffix, unknown)
  • xcodebuild test suite — this machine has Command Line Tools only, no Xcode; CI covers the new UnifiedPeerService / ChatPeerIdentityCoordinator tests

Made with Cursor

getPeerID(for:) and geohash geoNicknames.first(where:) returned the
first match, so /msg and /block could hit the wrong person when two
peers share a name. Accept an unsuffixed nick only when it is unique;
otherwise require the people-list #xxxx suffix.
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