Refine mobile navigation and creation flows#2810
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c8aedd31b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| final session = ref.watch(relaySessionProvider.notifier); | ||
| final currentPubkey = ref.watch(currentPubkeyProvider)?.toLowerCase(); |
There was a problem hiding this comment.
Invalidate the directory when the community changes
When two communities use the same signing key, switching communities leaves this non-auto-dispose provider cached because it watches only the preserved relaySessionProvider.notifier identity and a pubkey whose value remains unchanged. Reopening New message can therefore display users fetched from the previous relay and submit their pubkeys to the current relay; watch relayConfigProvider or activeCommunityProvider in both new directory providers so their data is refreshed at the community boundary.
AGENTS.md reference: AGENTS.md:L120-L120
Useful? React with 👍 / 👎.
| if (users.isNotEmpty) { | ||
| return users | ||
| .where((user) => user.pubkey.toLowerCase() != currentPubkey) | ||
| .toList(); |
There was a problem hiding this comment.
Merge relay agents into the recipient directory
On a normal relay containing at least one kind-0 profile, this early return prevents the membership fallback from contributing agents, while the search provider below also queries only kind 0. Agents represented solely by kind 10100 or relay membership—an explicitly supported case in mobile/lib/features/pulse/pulse_provider.dart—can never be selected for a DM; the desktop recipient picker avoids this by merging relay and managed-agent queries with profile results.
Useful? React with 👍 / 👎.
| final directoryEvents = await session.queryRelay([ | ||
| const NostrFilter(kinds: [0], limit: 50, extensions: {'page': 1}), | ||
| ]); |
There was a problem hiding this comment.
Page beyond the first 50 directory profiles
For communities with more than 50 kind-0 profiles, this hard-codes page 1 and the sheet exposes no fetch-more path, so every later profile is omitted from the browseable recipient list. The relay bridge already supports the page extension, and the desktop new-message directory advances its cursor when a full page is returned; mobile should likewise retain and fetch subsequent pages rather than treating this first page as the complete directory.
Useful? React with 👍 / 👎.
…ary (#2842) ### What changed? Made the mobile new-message directory providers (`relayDirectoryUsersProvider`, `relayDirectorySearchProvider`) `autoDispose`, and both now watch `relayConfigProvider` so they refetch when the active relay/community configuration changes. ### Why? Follow-up to #2810 (Codex P1 review flag: "Invalidate the directory when the community changes"). Both providers previously cached results for the whole app session. They watched only the relay-session notifier (a stable instance that survives dependency rebuilds) and the current pubkey, which keeps its value when two communities share a signing key. Switching between such communities could reopen the New message sheet showing the previous relay's people, and submit their pubkeys to the current relay. The search provider was also a non-autoDispose family keyed by raw query strings, so every distinct typed query leaked a cached provider entry for the session. Watching `relayConfigProvider` (which rebuilds on every community switch via `activeCommunityProvider`) invalidates cached browse and search results at the community boundary, and `autoDispose` releases the cache when the sheet closes. ### How is it tested? Full mobile suite green (585 passed / 1 skipped), `flutter analyze` clean. Added tests: - [`channel_management_provider_test.dart`](https://github.com/block/buzz/blob/gated/directory-provider-invalidation/mobile/test/features/channels/channel_management_provider_test.dart) — browse and search refetch on relay-config change with an unchanged session notifier and pubkey; cached search families are released once unlistened. Signed-off-by: npub1kqarnt4re38nuttqnml3mrqp8cnm6wzpywl2kesc2ejasp0luc5q275nkx <b03a39aea3cc4f3e2d609eff1d8c013e27bd384123beab66185665d805ffe628@buzz.block.builderlab.xyz> Co-authored-by: npub1kqarnt4re38nuttqnml3mrqp8cnm6wzpywl2kesc2ejasp0luc5q275nkx <b03a39aea3cc4f3e2d609eff1d8c013e27bd384123beab66185665d805ffe628@buzz.block.builderlab.xyz>
…chive * origin/main: (112 commits) docs(contributing): trim to goose-scale minimal intake surface (#2780) fix(relay): preserve reconnect backoff (#2759) refactor(relay): expose reconnect timing policy (#2310) fix(desktop): clear stale working badges on agent stop/restart (#2803) fix(desktop): surface agent rename relay profile sync failure as a warning toast (#2279) fix(docker): create /data/git so the compose volume inherits buzz ownership (#2840) fix(mobile): invalidate DM directory providers at the community boundary (#2842) feat(relay): make per-owner community limit configurable via BUZZ_MAX_COMMUNITIES_PER_OWNER (#2599) fix(discovery): inject PATH into Codex adapter planning (#2767) chore(release): release Buzz Desktop version 0.4.26 (#2808) Refine mobile navigation and creation flows (#2810) feat(relay): add author-only-unless-shared read gate for kind 30175 (#2768) fix(core): block IPv6 transition SSRF targets (#2801) Style mobile pairing QR codes (#2775) Refine community management flows (#2738) fix(workflow): bypass system proxies for webhooks (#2800) docs: replace VPN-vendor references with generic wording (#2805) docs: point readme at deploy compose bundle (#2363) fix(desktop): explain macOS local network access (#2263) fix(desktop): clarify CLI runtime setup (#2680) ...
…chive * origin/main: (112 commits) docs(contributing): trim to goose-scale minimal intake surface (#2780) fix(relay): preserve reconnect backoff (#2759) refactor(relay): expose reconnect timing policy (#2310) fix(desktop): clear stale working badges on agent stop/restart (#2803) fix(desktop): surface agent rename relay profile sync failure as a warning toast (#2279) fix(docker): create /data/git so the compose volume inherits buzz ownership (#2840) fix(mobile): invalidate DM directory providers at the community boundary (#2842) feat(relay): make per-owner community limit configurable via BUZZ_MAX_COMMUNITIES_PER_OWNER (#2599) fix(discovery): inject PATH into Codex adapter planning (#2767) chore(release): release Buzz Desktop version 0.4.26 (#2808) Refine mobile navigation and creation flows (#2810) feat(relay): add author-only-unless-shared read gate for kind 30175 (#2768) fix(core): block IPv6 transition SSRF targets (#2801) Style mobile pairing QR codes (#2775) Refine community management flows (#2738) fix(workflow): bypass system proxies for webhooks (#2800) docs: replace VPN-vendor references with generic wording (#2805) docs: point readme at deploy compose bundle (#2363) fix(desktop): explain macOS local network access (#2263) fix(desktop): clarify CLI runtime setup (#2680) ... Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>



Summary
Testing
just mobile-checkjust mobile-test