block / block/buzz

Mobile: New DM picker includes archived agent identities

Open
#7,504 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Summary

Buzz Mobile on iOS shows retired agent identities in the **New direct message** recipient picker even though those pubkeys are already archived in the relay's NIP-IA (`kind:13535`) snapshot.

This produces several visually identical entries for each agent and makes it unclear which identity is current. The archived identities should remain available for historical attribution, but must not appear in forward-looking discovery surfaces.

## Steps to reproduce

1. Own an agent that has been rebuilt or rotated several times.
2. Archive the retired identities through NIP-IA.
3. In Buzz Mobile on iOS, tap **Create or start conversation**.
4. Tap **New direct message**.
5. Search for the agent by display name.
6. Observe the current identity plus multiple archived identities in the recipient list.

## Expected behavior

The new-DM recipient picker excludes every pubkey present in the relay's latest valid NIP-IA archive snapshot and shows only the current active identity.

Historical messages remain unchanged and attributed to the archived pubkeys.

## Actual behavior

Archived and active identities appear together as separate, visually identical recipients.

In the reproduced hosted-community case:

- Fizz returned four matching profiles; three were already archived.
- Honey returned four matching profiles; three were already archived.
- The relay's archive snapshot correctly contained the retired pubkeys.

No destructive profile or message deletion is needed; the client is not applying existing archive state to this picker.

## Likely source boundary

`mobile/lib/features/channels/channels_page/sheets.dart` builds `_NewDirectMessageSheet.availableResults` directly from `relayDirectoryUsersProvider` or `relayDirectorySearchProvider` and filters only:

- already-selected pubkeys;
- the current user's pubkey; and
- the local text query.

There is no archived-identity exclusion in that path. A source search under `mobile/lib` also finds channel archival support, but no NIP-IA identity archive snapshot handling.

The NIP-IA client contract already says archived identities should be hidden from agent pickers and similar forward-looking discovery surfaces (`docs/nips/NIP-IA.md`, Client Behavior).

## Suggested fix

1. Load and verify the relay-scoped `kind:13535` archived-identity snapshot on mobile.
2. Expose the archived pubkey set through a provider scoped to the active relay/community.
3. Filter archived pubkeys from both the empty-query directory and search results before rendering the new-DM picker.
4. Add a widget/provider regression test containing one active and one archived profile with the same display name; assert only the active pubkey is selectable.
5. Fail safely if archive state is unavailable or untrusted, consistent with the NIP-IA trust rules.

## Version and platform

- Buzz version: unknown
- OS: iOS
- Source inspected: `block/buzz` local `main`

## Related issues

- #3840 — Mobile mention autocomplete includes archived agent identities. This report covers the separate **New direct message** directory/picker surface.
- #2973 — Cannot archive/remove stale duplicate agents from Buzzboard.

No private relay hostname, channel IDs, message contents, or full agent pubkeys are included.

Contributor guide

Open the contributing guide

Research direction

Start in mobile/lib/features/channels/channels_page/sheets.dart, tracing _NewDirectMessageSheet.availableResults and its relayDirectoryUsersProvider or relayDirectorySearchProvider inputs. Read docs/nips/NIP-IA.md and inspect mobile/lib for existing archive support before locating the relay-scoped snapshot path. Done means the empty and searched picker results exclude trusted archived pubkeys, while a widget/provider test keeps the active profile selectable and historical messages unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.