Mobile startup issues a burst of ~106 relay /query requests, 27 of them empty

Open
#7,733 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
dart

Research direction

Start with mobile/lib/shared/relay/relay_session.dart and trace queryRelay() through the three listed provider callers. Reproduce the startup burst using the Caddy JSON access log and count /query requests and empty filters. Done means startup uses a single batched sync and later changes use the existing WebSocket subscription rather than repeated relay requests.

Written by the indexing model from the issue text.

Description

Self-hosted relay, Buzz Desktop 0.5.23, mobile client. Source pinned at c507a4d488ca27796e78d876b9c24ee38442cc1b.

Symptom

Opening the mobile app issues a burst of relay /query HTTP requests. Over a 3-minute window, one client IP produced 106 /query, of which 27 had Content-Length: 2 (an empty filter):

106 x /query   (7-25 ms each, 200)
  6 x /events  (13-16 ms each, 200)
Content-Length distribution:
  27 x 2        <- empty
  18 x 5830
  14 x 427
  10 x 295
  10 x 2461
   8 x 155

The relay is not the bottleneck: every request returns in 7-25 ms and the relay sits at 0.5% CPU. The cost is the number of round-trips on a mobile connection.

Expected

A single batched sync on open, then incremental updates over the existing WebSocket subscription.

Where to look

  • mobile/lib/shared/relay/relay_session.dartqueryRelay() (the /query bridge)
  • Callers: mobile/lib/shared/community/community_membership_provider.dart, mobile/lib/features/channels/channel_management_provider.dart, mobile/lib/features/invites/invite_create_provider.dart

Reproduction

Point the relay's Caddy at log { output stdout format json level INFO }, open the mobile app, and count uri":"/query" in the access log.

Dominant language
Rust
Stars
33.7k
Forks
4.4k
Avg merge
1d 21h
Merged PRs (30d)
239

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from block/buzz

All issues in block/buzz

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.