fix(mobile): invalidate DM directory providers at the community boundary#2842
Conversation
The new-message directory providers cached their results for the whole app session: relayDirectoryUsersProvider watched only the stable relay-session notifier instance plus the current pubkey, and relayDirectorySearchProvider was a non-autoDispose family keyed by unbounded query strings. Switching to a community that shares the same signing key therefore kept serving the previous relay's people, and every distinct search query leaked a cached provider entry for the session. Make both providers autoDispose and watch relayConfigProvider so a community switch (relay URL change) refetches browse and search results, and cached entries are released when the sheet closes. Follow-up to #2810 (Codex P1: invalidate the directory when the community changes). Co-authored-by: npub1kqarnt4re38nuttqnml3mrqp8cnm6wzpywl2kesc2ejasp0luc5q275nkx <b03a39aea3cc4f3e2d609eff1d8c013e27bd384123beab66185665d805ffe628@buzz.block.builderlab.xyz> Signed-off-by: npub1kqarnt4re38nuttqnml3mrqp8cnm6wzpywl2kesc2ejasp0luc5q275nkx <b03a39aea3cc4f3e2d609eff1d8c013e27bd384123beab66185665d805ffe628@buzz.block.builderlab.xyz>
|
@codex review |
|
@builderbot review |
|
To use Codex here, create a Codex account and connect to github. |
wesbillman
left a comment
There was a problem hiding this comment.
Reviewed exact head 64356f7f42edce1361a02490788ea4f734391d5d.
The explicit relayConfigProvider dependency correctly invalidates browse and search results across same-signing-key community switches, while autoDispose bounds both the sheet cache and search-family cardinality. I traced the sole production consumer, relay-config/session sequencing, retry/loading behavior, and Riverpod generation behavior for late futures. The tests isolate config invalidation with a stable session notifier and pubkey, and prove both refetching and family disposal.
No blocking findings. Exact-head Mobile CI is green: analyzer clean, 585 passed / 1 skipped, and Android debug build succeeded.
…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>
What changed?
Made the mobile new-message directory providers (
relayDirectoryUsersProvider,relayDirectorySearchProvider)autoDispose, and both now watchrelayConfigProviderso 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 viaactiveCommunityProvider) invalidates cached browse and search results at the community boundary, andautoDisposereleases the cache when the sheet closes.How is it tested?
Full mobile suite green (585 passed / 1 skipped),
flutter analyzeclean.Added tests:
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.