fix(search): exclude archived identities from profile search - #7368
Open
clawilution wants to merge 1 commit into
Open
clawilution wants to merge 1 commit into
clawilution wants to merge 1 commit into
Conversation
NIP-IA archived identities kept surfacing in kind-0 profile typeahead — add-member pickers, mention candidates, and invites listed retired duplicate identities alongside (and ahead of) their replacements. The archived_identities record is a community-local UI visibility hint, and the people directory is the UI it must hide. The FTS layer now excludes events authored by an archived pubkey when the query targets kind 0 only. Message-history search is untouched: archiving is not a ban, and per NIP-IA history remains searchable. Add a Postgres integration test: an archived identity's kind-0 profile disappears from prefix search, an active control profile stays, and the archived identity's kind-9 messages remain searchable. Signed-off-by: Fizz <264668191+clawilution@users.noreply.github.com>
🔐 Codex Security Review
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Archived identities (NIP-IA
archived_identities) kept appearing in kind-0 profile search results — the add-members picker, mention typeahead, invite search, and the CLIusers get --namelane all surface FTS profile hits. On a self-hosted relay that retired several duplicate identities, all of the retired ones kept showing up in every people picker, one misclick away from re-adding or re-tagging an identity that no longer exists.This is the server-side complement to the existing client-side fixes: the FTS layer in
buzz-searchnow excludes events authored by an archived pubkey when the query targets kind 0 only. Message-history search is intentionally untouched — archiving is a visibility hint, not a ban, and per NIP-IA history remains searchable.Related issue
None found for the relay/search layer. Closest existing work is client-side: #5034 and #6548 (mobile mention autocomplete), which hide archived identities in the app's candidate list. Those remain valuable; this PR covers the shared server-side lane so every client benefits without per-app filtering.
Testing
profile_search_excludes_archived_identities: an archived identity's kind-0 profile disappears from prefix search, an active control profile still matches, and the archived identity's kind-9 messages remain searchable.buzz-searchsuite against Postgres 17: 3 unit + 20 integration tests pass (cargo test -p buzz-search --tests -- --include-ignored).cargo fmt --all -- --checkandcargo clippy -p buzz-search --all-targets --all-features -- -D warningsclean on currentmain(f038cbb).