iOS UX: agent can show typing while profile remains offline after reconnect
- Dominant language
- Rust
- Stars
- 32.7k
- Forks
- 4.3k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 253
Description
## Summary
On iOS, an agent can visibly be typing/working in a channel while its profile reports **Offline**, especially after the phone reconnects to the relay. This is a UX consistency bug: two live indicators for the same agent disagree, making an active hosted agent look unavailable.
## Steps to reproduce
1. Run an agent from Buzz Desktop or another hosted machine and join the same channel on iOS.
2. Disconnect/reconnect the iPhone client, or open it after the agent's latest presence event was already published.
3. Trigger the agent so iOS shows it typing/working.
4. Open the agent profile on iOS.
5. Observe that the profile can still show **Offline**.
## Expected behavior
- A reconnect should restore the latest non-expired presence state instead of waiting indefinitely for a future presence publication.
- If current channel typing/working telemetry proves the agent is active, iOS should not simultaneously present it as offline.
- Presence, typing, and activity surfaces should converge on a clear current state without treating typing as durable presence after it expires.
## Current implementation
- [`presence_cache_provider.dart`](https://github.com/block/buzz/blob/2ea9385015fb922de2adf0a53e86fc5a21d07b90/mobile/lib/features/profile/presence_cache_provider.dart#L8-L46) documents that there is no historical/REST backstop and `track()` performs no fetch; the cache only receives future live kind `20001` events.
- [`user_profile_sheet.dart`](https://github.com/block/buzz/blob/2ea9385015fb922de2adf0a53e86fc5a21d07b90/mobile/lib/features/profile/user_profile_sheet.dart#L50-L80) defaults a missing cache entry to `offline`.
- [`working_bots_provider.dart`](https://github.com/block/buzz/blob/2ea9385015fb922de2adf0a53e86fc5a21d07b90/mobile/lib/features/channels/agent_activity/working_bots_provider.dart#L6-L27) independently derives working agents from channel typing events, which permits the contradictory UI state.
## UX impact
Users cannot trust agent availability on iOS and may avoid opening or messaging an agent that is visibly working. This overlaps the presence symptom reported for Android in #2971, but this issue is specifically the iOS reconnect plus typing/offline contradiction.
Related client UX: #5062.
Contributor guide
Research direction
Start by reading mobile/lib/features/profile/presence_cache_provider.dart, then compare its reconnect behavior with mobile/lib/features/profile/user_profile_sheet.dart and mobile/lib/features/channels/agent_activity/working_bots_provider.dart. Trace how cached presence and channel typing events reach the iOS UI. Done means reconnecting restores a current non-expired presence state and typing does not leave the profile showing Offline, while expired typing is not treated as durable presence.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, ios
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100