Files
buzz/mobile/lib
Wes db50afd8a7 perf(mobile): load the channel list's membership-scoped reads together (#8462)
## Summary

At startup and on every community switch, the channel list waits on a
chain of relay reads, one round trip after another. Four of those reads
need only the membership ids: channel metadata, hidden DMs, member
snapshots and Huddle starts. Yet each one waited for the read before it.

They now go out together, right after the membership list. Everything
that depends on them is unchanged: DM participant names still follow
metadata, and the latest-message batch still follows the filtered list.

- `Future.wait(eagerError: true)` handles every request's failure and
rethrows the first one unchanged, as soon as it happens. Before this
change a failed read also stopped the chain. Hidden DMs and Huddle
starts still fall back to empty on failure, as before.
- The refresh fence checks the combined result once, before any state is
written. That's the same fence check each read had before.

This keeps the duplicate member-snapshot read. Replacing it with the
membership list's events would need a relay-contract check first.

## Before and after

Setup:
- Simulator, debug build.
- Local relay with about 120 ms of added round-trip time.
- Seeded community with 120 channels.
- 5 cold launches each, after one warm-up launch, on the same build with
and without this change.
- Timed with local probes that are not part of this PR. All 10 launches
loaded 120 channels.

| | `main` | this PR |
|---|---|---|
| Connected → channel list ready (median) | 1,233 ms | 715 ms |
| Range | 1,154–1,297 ms | 689–747 ms |

## Test

A test parks the metadata, hidden-DM and member-snapshot reads at the
same time, then checks that all four reads were sent. If any read waits
on another, it stays unsent and the test fails. It fails on `main`,
where only metadata goes out, and on a version that sends metadata first
and the rest after. Three switch tests park before discovery now, so
their names say "during a directory refresh" instead of "after directory
success".

## Validation

- `flutter analyze`
- Full mobile suite: 3,535 passed.
- The simulator runs above.

**Human test:** Wes ran #8456, #8460 and #8462 together on the simulator
with his real account and confirmed they work.

buzz-review-completed

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:09:29 -06:00
..