mirror of
https://github.com/block/buzz.git
synced 2026-11-24 10:12:19 +00:00
chart-v0.1.13
708 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
2074adaa85 |
fix(mobile): bring @mention typing in line with buzz-app (#9699)
## Summary The mobile composer's @mention typing was an older port of the mention rules that [block/buzz-app](https://github.com/block/buzz-app) follows (`src/bundled/mentions/README.md` there), and it trailed buzz-app in nine places. Most of them came from one difference: mobile tied a picked person to the `@Label` text and looked for that text again at send time, while buzz-app keeps the recipient on an atomic chip. Several of the gaps meant a picked person was silently not notified. This PR fixes all nine. Every change is in `mobile/`; no relay, CLI or desktop code is touched, and the event payloads mobile writes keep the same shape. ### Commits | Commit | Fixes | What it changes | |---|---|---| | |
||
|
|
bc0b552894 |
fix(mobile): report failed reaction publishes instead of throwing (#9813)
Tapping a reaction while the relay is disconnected threw an uncaught `RelayNotConnectedError` (a `StateError`) from `RelaySessionNotifier.publish`, reported by Sentry from 1.5.0 builds. Every reaction call site fires `addReaction` or `removeReaction` without awaiting it, so any publish failure escaped as an unhandled error and the pill just didn't change. Now each of those call sites (pill taps, the `+` picker, the long-press quick-reaction row and grouped system rows) hands its publish to `reportReactionFailure`, which shows an error notice. It's a toast drawn above any Flutter route or sheet, including the Android reaction details sheet. While the native iOS reaction details sheet is open, that sheet shows the notice itself as an alert, since UIKit covers Flutter's overlay: - "Couldn’t add reaction. No connection." (or "remove") when the relay isn't connected; - "Reaction not confirmed. Connection lost." or "… The relay didn't respond." (or "Removal not confirmed. …") when the acknowledgement was lost or late, since the relay may have accepted it; - nothing for the relay's `duplicate:` reply to a reaction you already have (a double tap, or re-picking it from the picker), which is a success; - "Couldn’t add reaction. Try again." for anything else. Errors that aren't relay outcomes (for example the signer failing) still escape afterwards with their stack, so the uncaught-error handler reports them as before. | Before (offline tap) | After (offline tap) | | --- | --- | | <img alt="before" src="https://github.com/user-attachments/assets/7745ec5b-8f54-41a2-ba3d-b8dd599f127c" width="300"> | <img alt="after" src="https://github.com/user-attachments/assets/066fba0b-9580-4250-966e-cd0b99831ecc" width="300"> | ### Regressions - Successful reactions behave exactly as before: the UI still doesn't await the publish, and the notice only appears on failure. - Removing a reaction from a grouped system row publishes every deletion at once as before, and shows at most one notice if any fail. - Unexpected local errors reach diagnostics just as they did on main. - No new state or retries: a failed reaction isn't queued. It's reported instead of thrown. ### Validation - Added tests in [`reaction_row_test.dart`](https://github.com/block/buzz/blob/fix-reaction-publish-stateerror/mobile/test/features/channels/reaction_row_test.dart): offline add and remove, a lost ack, a duplicate and an unexpected signer failure, each with the notice it should show (or none), and whether the error escapes; plus a failed toggle from the reaction details sheet on Android and iOS. - Simulator run (iPhone 17 Pro, signed in to a Builderlab community, in a QA chat): add and remove online through the long-press quick-reaction row, the `+` picker and the reaction details sheet. The before and after captures come from builds that force reaction publishes to fail as if offline (the simulator can't drop its own network). The after build shows the toast once the quick-reaction sheet has closed. - A failed removal from the reaction details sheet shows its notice above the sheet, which stays open. Widget tests cover the Flutter sheet and the native-sheet `notice` call; a simulator run with a build that forces removals to fail showed the native alert on the iOS sheet: After: failed removal in the native reaction details sheet https://github.com/user-attachments/assets/b8d808f0-e86b-411f-82c0-c3d19a51b231 --------- Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> |
||
|
|
0636d21479 |
feat(mobile): report push gateway replies the app cannot read (#9806)
Reports push gateway replies the app cannot read, the last explicit
error report from [the diagnostic reporting
spec](https://github.com/block/buzz/blob/main/docs/mobile-diagnostic-reporting.md)
still missing.
The gateway is called from native code (`BuzzDevPushEnrollmentDriver`),
and Dart used to see every native failure as one code. Native now fails
with its own `gateway_response_invalid` code when a reply does not match
the gateway's protocol (bad JSON, a 2xx status other than the one the
gateway sends for that call, or a challenge, installation or delegation
reply with missing or invalid fields), carrying no text from the reply.
Dart reports that as a push gateway response error and rethrows as
before.
- **Not reported:** status mismatches (including 4xx and 5xx), timeouts
and offline failures, which the spec counts as routine; local-state
failures such as an App Attest key mismatch; and a plausible challenge
that has already expired by the device's clock, since a phone whose
clock runs fast would otherwise report on every retry. An expiry no real
challenge could have (zero, negative or a relative TTL) is still
reported. Local enrollment logs keep the fixed name of the failing
route.
- **Attribution:** the report goes through the signing member, so an
enrollment that finishes after a community switch names no one else.
## Validation
- `push_bridge_test.dart`: an unreadable reply is reported once and
enrollment still fails; routine native codes report nothing.
- `BuzzDevPushEnrollmentDriverTests`: bad JSON and an unexpected 2xx
fail as an unreadable reply; a 503 stays a status mismatch; a plausible
but expired challenge is not an unreadable reply, while an expiry of 0,
-1 or 300 is.
- `notification_toggle_test.dart`: an unreadable reply during the
notification journey files one report while the member matches and none
after it changes.
Full-app run on an iPhone 17 Pro simulator at
|
||
|
|
ec1b786ef0 |
fix(mobile): diagnostic reporting follow-ups (#9808)
Follow-ups to the mobile diagnostic reporting work in
docs/mobile-diagnostic-reporting.md.
## Changes
- **Install ID repair:** if the install ID file holds something that
isn't text, the app now replaces it with a new ID, as it already does
for an empty file. Before, every report went out without an install ID.
A read that fails (for example, no file descriptor free) still keeps the
file, so a passing error never replaces a good ID.
- **Clock-window refusals are not reported as errors:** the spec treats
relay refusals for a timestamp outside the relay's clock window as
expected (counting them is still pending). The app only recognized one
of the relay's wordings ("timestamp too far from server time"), so
refusals for canvas events, relay-admin commands, leave requests and
observer frames were reported as invalid requests. The five wordings are
matched from the start of the reason, so unrelated `invalid:` reasons
that mention a timestamp, such as the feedback timestamp overflow or one
that echoes a value, are still reported.
- **Diagnostics card:** rows get subtitles, and the divider indent
matches the neighbouring Settings cards.
- **Comments:** explain why push stop gates its current-identity request
on the community key, and correct a test comment about who drops a
repeated error object.
## Validation
New tests cover:
- member attribution on relay sessions, including a missing key and an
answer that arrives after the member changed;
- push stop reports while signed out;
- reporter wiring for hosted admission and the self-hosted probe;
- frames the socket can't decode;
- a table of relay refusal reasons, each either reported or not, for
both `OK` and `CLOSED`;
- an install ID file whose reads fail keeps its ID.
Full-app run on an iPhone 17 Pro simulator at
|
||
|
|
51b0ea62be |
fix(mobile): skip the emoji picker when its opener is gone (#9820)
On iOS, opening the emoji picker from a context that had already been
unmounted threw `StateError('No ProviderScope found')` from
`ProviderScope.containerOf`. It threw after the picker had taken its
one-sheet-at-a-time guard, so every later emoji picker open in that
session was silently refused until the app restarted.
The message actions sheet hits this: its "+" tile opens the picker on
the long-pressed message row's context, which the timeline can rebuild
away while the sheet is open (the reported crash came from a phone in
landscape, tapping "+" in the quick reaction row).
`showEmojiPicker` now returns early, completing the caller's
`onDismiss`, when its context is no longer mounted, and the guard is
never taken. That tap still opens no picker (the message usually stays
on screen, but its row was rebuilt), so the user has to retry, but later
opens keep working.
### Validation
- Added [an iOS picker
test](https://github.com/block/buzz/blob/fix-ios-emoji-picker-dead-context/mobile/test/features/channels/emoji_picker_test.dart)
that opens the picker from a rebuilt-away context, then checks the
caller's dismissal runs and a later open from a live context still
presents the native sheet.
- Ran the fixed build in an iPhone 17 Pro simulator against a live
community: long-pressed a message, tapped "+" in the quick reaction row,
picked an emoji from the native sheet and saw the reaction land; then
repeated on a second message to confirm the picker opens again (with the
first pick under Frequently used). The simulator can't reproduce the
rebuilt-row race itself; the added test covers that.
### Regressions
None expected. The only behavior change is for an opener whose widget is
already gone, which previously threw and blocked the picker. Mounted
callers take exactly the same path as before.
Signed-off-by: Tom Brow <tomb@block.xyz>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
|
||
|
|
7681371b94 |
fix(mobile): clear the Duo top edge in the Activity header (#9807)
## Summary On iPhone Duo, the Activity page's custom header put Close and the "Activity" title 8 points below the window's top edge. The Duo panes report no top safe area beside the strip, so the 8-point row padding was the only clearance. This happened on the cover display and in the inner display's wide layout. Other Duo pane headers already reserve 24 points above their 44-point controls (`FrostedAppBar` and the native bar in `IosNavigationBar.swift`). Activity now does the same: - `activity_page.dart`: on iOS with a Duo strip, the header row's top padding is `duoHeaderTopClearance` (24). Otherwise it stays `Grid.xxs` (8). The bottom padding stays 8. - `duo_toolbar.dart`: adds `duoHeaderTopClearance = 24`. - `frosted_app_bar.dart`: uses the constant in place of its literal `+ 24`. No value change. **Pareto:** better on the Duo cover and in the wide layout. No change on regular iPhones (no strip), Android, or the Duo inner display in portrait (no side strip; it already has an 82-point top inset). No new rebuild dependencies: `strip` was already read through `DuoToolbarScope.maybeStripOf`. ### Related issue None found. ### Testing - New widget test `Activity header clears the top edge on …` checks the header row's top edge on the Duo cover (466×678, right strip), the Duo wide layout (951×669), an iPhone (62-point top inset), and Android. It fails on `main` for both Duo cases (8, expected 24) and passes with this change. - `dart format --set-exit-if-changed .` and `flutter analyze`: clean. - `flutter test` (mobile): passes on macOS. - iOS 27.2 simulators, measured in points from the top edge: | Device / layout | Before | After | |---|---|---| | Duo cover, Close and title row | 8 | 24 | | Duo wide layout, title row (Close in the rail) | 8 | 24 | | iPhone 18 Pro | 70 | 70 | #### Before / after Captured on iOS 27.2 simulators. Before is `main` at `9c0bcd6239`, after is this branch at `4400d021b`. In each pair, before is on the left and after is on the right. Duo cover display: open Activity from the bell, hold, then Close. https://github.com/user-attachments/assets/5bda190c-cadf-44a8-9a8e-58bc68838e7b     🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Stephen Barnes <799470+smbarne@users.noreply.github.com> Co-authored-by: Stephen Barnes <799470+smbarne@users.noreply.github.com> |
||
|
|
9c0bcd6239 |
Align Duo chat headers, inset Home selections, and fix received photo-stack swipes (#9795)
- In unfolded Duo portrait, place the live chat avatar and name together beside Back. Align the Messages and Activity headers with the status controls and keep the filters full width. - Center the stacked avatar and chat title over the sticky date with the Duo rail on either side. - Give Home selections rounder corners and a shared 12-point outer gutter for channels, DMs, and Solo chats. Preserve icon and label alignment. - Mirror drag distance and flick velocity for received photo stacks so a rightward swipe advances the stack. The combined release preview was installed and checked on a physical Duo. Widget tests cover the portrait header geometry, filter width, and return to landscape. ### Portrait layout references Cropped headers from the earlier Duo preview used as the design reference.   ### Simulator snapshots The fixtures use sample content and a 76-point right rail inset.   --------- Signed-off-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> |
||
|
|
97bec174a4 |
fix(mobile): only dot channel-sent replies in the reader's threads (#9696)
## What changed Mobile matches block/buzz-app#3938. A reply someone sends with **Also send to channel** used to light the channel's attention dot and count toward the app icon badge for everyone in the channel, even people who never joined that thread. Now it follows the same rule as any other reply: - **Dot** if it mentions you, or it's in a thread you're part of (you started it, replied in it, or follow it). - **Bold only** otherwise, like a new top-level post. It no longer counts toward the app icon badge. Reading is unchanged. These replies are still marked read individually, as desktop reads them, so reaching the bottom of the channel doesn't silently mark them read on one device but not the other. ## How - The "is this one of my threads" check that already decides which ordinary replies count is now shared, and channel-sent replies go through it when deciding attention. - On mobile, "earns a dot" and "is read by reaching the bottom of the channel" were one flag. Dropping a channel-sent reply's priority would have also changed how it gets read, drifting from desktop. The dot now comes from its own field; every other kind of message gets exactly the same dot and read behavior as before. ## Tests New cases drive live events through the channel list. For each, they check the observed unread entry, whether its thread shows in Activity, the app icon badge, the channel list's bold vs dot, and reading: - reply sent to the channel in someone else's thread: bold, no dot, not in Activity, counts as ordinary unread on the icon (same as a top-level post) - same, but mentioning the reader: dot, in Activity - in a thread the reader follows: dot, in Activity - in a thread the reader started: dot, in Activity - in a thread the reader replied in: dot, in Activity In every case, a channel catch-up mark leaves the reply unread and its own read mark clears it. The "someone else's thread" case fails on `main` (it gets a dot). The pre-push mobile checks (format, analyze, full mobile test suite) passed on this head. ## Known gaps (not changed here) - Mobile only knows the threads you're part of from posts it has seen on this phone. A fresh install doesn't know about older threads you joined elsewhere, and a reply's first classification sticks even if later loading shows you joined that thread. Desktop looks these up on the relay. - Mobile has no explicit "Unfollow" for a thread you started or replied in (the menu only offers Follow there), so you can't silence one the way desktop can. This applies to all replies, not just ones sent to the channel. - A reply sent to the channel still counts as unread in a muted channel. That was already true before this change. No screenshots: no visual element changes, only which existing state (bold or dot) a channel shows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> |
||
|
|
14e5ea7cc4 |
Mobile: refine section filters and ordering in Messages (#9796)
## Summary Give Messages sections a common options sheet for sorting, filtering and ordering. Active sections let people choose a time window. Channel and DM sections can reveal filtered rows in place with **Show more** and collapse them with **Show fewer**. Reordering saves a device-local order for the current account and community. Failed activity lookups keep affected channels visible. The recovery toast offers Retry and dismisses when activity loads. On iOS the sheet dims the Messages header along with the list. ### Related work #9707 explores a count-based disclosure. This change uses the section’s unread or activity filter. ### iOS snapshots | Section options with an active filter | Reorder sections | | --- | --- | |  |  | ### Rename a section Tap the emoji beside the name to open the picker. Set saves both fields, including an emoji-only change.  ### Activity recovery and section order Unfiled Solo chats support local **Show more** and **Show fewer**, including offline. Failed activity lookups retry automatically up to three times with jittered backoff while Messages is visible and connected. **Retry** stays available after that budget is exhausted. The notice dismisses on recovery. Reorder supports drag handles and keyboard arrow keys. Saving preserves the position of an empty Starred section and checks for a newer order. Each signing identity has its own saved order per relay. ### Testing Exercised filtering, reorder and dismissal in the iOS simulator. The preview was also tested on iPhone Air. At `6135e314f3`, Flutter analysis and the full pre-push mobile checks passed (5,613 tests passed, 71 skipped). Widget regressions cover offline Solo disclosure, retry exhaustion, route visibility, keyboard reorder, large text, and editor cancellation. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> |
||
|
|
e2bbd8430c |
feat(mobile): report explicit diagnostic errors (#9673)
Step one of [mobile diagnostic
reporting](https://github.com/block/buzz/blob/main/docs/mobile-diagnostic-reporting.md),
second piece: the explicit error reports the spec lists, through the
reporter added in [#9613 diagnostic reporting
module](https://github.com/block/buzz/pull/9613). A build without a
destination (every build from this repository alone) still reports
nothing.
### What's in it
Each report carries its `operation` tag, the error's type and stack
trace, and no error text (the filter replaces it).
- **Event subscriber (`eventSubscriber`):** a subscriber that throws
while the relay session delivers a buffered batch is reported, and the
rest of the batch is still delivered. In a build without a destination
the error still surfaces as uncaught, so it fails the test that hit it
and prints in development, as before. Before, one throw dropped the rest
of the batch, and those events never came back because their delivery
keys were already recorded.
- **Relay frames (`relayFrame`):** a frame the socket can't decode, or
whose body isn't a JSON array, is reported instead of silently skipped.
- **Relay queries (`relayQuery`):** an HTTP query body that can't be
decoded, including the read-state snapshot.
- **Invalid-request rejections (`relayRejection`):** an `OK false` or
`CLOSED` whose reason starts with `invalid:`, reported as a fixed
`RelayInvalidRequest` with no relay text, including an `OK` with no
pending publish (a typing indicator, or a reply after a timeout).
Refusals the app handles as expected outcomes (an archived channel, an
Unarchive of a channel that is no longer archived, an open channel name
that is taken, an agent whose `policy:` refuses being added, a sole
owner's Leave refused as the last owner, a guest's Add Members refused
because only members can add people, an event whose timestamp is outside
the relay's window, so a wrong device clock does not report every
publish) are left out. The long-lived relay session, the short-lived
sockets (hosted admission, the self-hosted probe, one-shot publishes
such as agent registration and push tombstones) and the account
assertion requests made for a community's key (relay access and push
stop assertions) report frames and rejections the same way, except while
reports name a member other than the key they sign with. A removed or
inactive community's tombstone, or the probe of a community being
joined, then reports nothing rather than naming the wrong member. With
no member set (first run, or after the last community is removed) it
reports under the install identifier.
- **Account responses (`accountResponse`):** a Builderlab account
response that isn't a JSON object, or a 2xx exchange or `/v1/auth/me`
response missing its credential, subject or expiry. Non-2xx statuses are
expected outcomes and aren't reported.
- **Push gateway responses (`pushGatewayResponse`):** a malformed push
capability descriptor from the relay. A relay that leaves
`supported_extensions` out or sends none has no push and isn't reported,
and a fetch that finishes after a community switch has begun isn't
reported either, since it would name the next member. Push gateway
replies aren't reported yet.
- **Stored data (`storedData`):** a saved community list that can't be
read back.
- **Member on switch:** switching communities now looks the new member
up in storage, not in the provider's list, which can still be the
previous one while it reloads after sign-in. It reads storage before
tearing anything down, so a failed read leaves the switch unchanged and
retryable.
- **Filter:** also drops a report's additional data (`extra`). Nothing
sets it today.
- The spec's status line now says what is implemented.
- Event delivery moves from `relay_session.dart` into a part file,
unchanged apart from the subscriber guard, so the session stays under
its size limit.
### Regressions
None expected: each change only adds a report where an error was already
caught or skipped. The one behavior change is that a throwing event
subscriber no longer costs the rest of its batch.
### Validation
Added tests for each report site (relay session, socket frames, one-shot
publishes, read-state snapshot, closed-reason policy, account client,
push descriptor and capability provider, community storage), for the
relay session (member changed mid-request), one-shot sockets and
assertion requests reporting nothing while another member is set and
reporting with none set, for the member on switch and a switch whose
read fails then retries, and for the filter dropping additional data and
leaving a message-less event without one.
Full-app run on an iPhone 17 Pro simulator at
|
||
|
|
03d09e20e3 |
fix(mobile): keep the agent poster over a failed iOS player (#9693)
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> |
||
|
|
d647c9fd98 |
Refine iOS composer and transcribe recordings into drafts (#9574)
Refine the iOS composer with 40-point glass controls, native attachment menus, persistent emoji access, and selected-text formatting. The mic now transcribes recordings on device into an editable, unsent draft; Dictation has no five-minute recording cap or timer label, and its waveform fills the space between the controls. Voice note remains available in attachments with its five-minute cap. Unsupported devices fail before recording, and audio is retained until the draft is durably saved. Stopped dictation remains recoverable across editor teardown; failed retention and cleanup can be retried. Recovered transcripts are inserted only once across navigation or restart, preserving live exact mention bindings. Preserve selection handles over glass with animated avatars. Reduce the conversation fade to 100 points above the keyboard and transition continuously to 180 as the keyboard closes, without a first-frame jump when opening; Home is unchanged. Validation: 5,117 mobile tests and 27 crypto tests pass; analysis passes. Prior native suite on iPhone 16/iOS 26.5: 119 pass, one pre-existing expected failure, zero unexpected failures. Physical Air preview approved; simulator selection/dragging and attachment flows exercised. Fixed the native navigation test's timing race and a community-cache cleanup test that checked a parent directory before its asynchronous removal completed. Repository-wide `just ci` previously stopped in unchanged `buzz-test-client` load-generator tests; new-head hosted checks are pending. Snapshots: production composer in an iPhone Air simulator fixture with fictional conversation text; Photos snapshot retained from the attachment preview. | Composer | Attachments | Photos | | --- | --- | --- | |  |  |  | --------- Signed-off-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: Tom Brow <tomb@squareup.com> Signed-off-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: Tom Brow <tomb@squareup.com> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> Co-authored-by: Princess Donut <b238ea756dee4d98afa5883fc7f1de61eeabe65bf700e3a5a5a80db5e42e2c2b@buzz.block.builderlab.xyz> |
||
|
|
a45f52a95c | fix(mobile): recognize agents without NIP-OA in Huddles (#8545) | ||
|
|
a79cbb4664 |
perf(mobile): stop re-scanning the unread backlog on channel list rebuilds (#9780)
## Summary Scrolling the mobile channel list hitched repeatedly after the app had been closed for a long time. To decide which rows are bold and which get a dot, the channel list read every unread message held in memory, for every channel, on every rebuild. After a long absence the unread catch-up holds up to 1000 messages per channel, so each list update cost more than a frame. This change makes a list rebuild independent of the backlog size: - A channel's messages stop being read once its bold and dot state is decided. - Each channel's result is reused until its messages or the read state change. A new message re-reads only its own channel; reordering or filtering the list re-reads nothing. Which rows end up bold or dotted is unchanged. ### Related issue N/A. None found. ### Testing Before (left) and after (right), same script on an iPhone 17 simulator: 200 channels each holding 1000 unread messages, a list update every 150 ms, and a scripted finger (the crosshair) dragging at a steady 420 px per second. https://github.com/user-attachments/assets/07b39b61-406f-4b4b-baca-69aa5be42db7 | | Before | After | |---|---|---| | Frames drawn in the 11-second drag | 279 | 499 | | Frames over 25 ms | 127 (46%) | 92 (18%) | | Median frame | 21.1 ms | 17.2 ms | | Worst frame | 116.8 ms | 65.2 ms | The recording uses scripted data in a debug build, which drops some frames even with no list updates, so the "after" side is not perfectly smooth. Whole frame after one list update, 200 channels, in a widget test on a Mac (not a phone): | Unread messages held per channel | Before | After | |---|---|---| | 0 | 13.3 ms | 12.7 ms | | 300 | 16.5 ms | 6.8 ms | | 1000 | 37.4 ms | 6.6 ms | - New tests in `channel_unread_test.dart` compare the new pass with a copy of the old full scan across a table of cases and 600 random steps of adds, deletions and read marks, and count messages read to guard the early exit and the reuse without timing. - `flutter analyze` and the mobile channel and home tests (2,983) passed with these two commits on `8827f986e43`. They were not rerun after the rebase onto current `main`, so CI is the check for that. - Not run on a phone or against a real community. Worth a close look in review: the reuse depends on every place that changes the stored unread messages marking that channel as changed. The new tests drive this through a stand-in, so they do not prove each real call site does it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: mtoohey <mtoohey@squareup.com> Signed-off-by: Matt Toohey <contact@matttoohey.com> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> |
||
|
|
ee4a6ed6b6 |
feat(mobile): restore the iOS share extension in the build (#9783)
Restores the iOS share extension target that #9489 unhooked from the Runner project because release builds couldn't sign it yet. Release signing for the extension's bundle identifiers is now configured, so this is a straight revert of that commit. No visible change beyond the extension reappearing in the iOS share sheet, as it did after #9433. Signed-off-by: Tom Brow <tomb@block.xyz> |
||
|
|
a303d7d5b5 |
fix(mobile): send Siri Bestie messages without confirmations (#9779)
Saying "Message my Bestie" to Siri (or running it from the Action button or Shortcuts) now sends the dictated message straight away. Siri no longer asks "Send … to <Bestie>?" before sending or shows a "Sent." dialog afterward. The Bestie's display name was looked up only to word that confirmation, so that lookup is gone too: the Flutter side no longer preloads the Bestie's profile or returns its name, and the bridge's `confirm` callback is removed. ### Regressions - A misheard message, or a Bestie changed on another device that this one hasn't synced yet, now sends without a chance to cancel. We accept that: the point of the shortcut is a hands-free send, and the message still appears in the Bestie DM, where it can be deleted. - This includes runs while the phone is locked and Shortcuts automations that supply the message: both send immediately, by design. - The community-switch guard stays: a Bestie looked up in one account or community still can't be sent to from another. - Nothing outside the Siri intent changes. ### Validation - The app code at this head (the last commit only touches a test) is built into a Buzz Dev development build installed on an iPhone 16e. The Siri flow itself has not yet been run on that build. - Updated [quick_send_test.dart](https://github.com/block/buzz/blob/tomb/siri-no-confirm/mobile/test/features/channels/quick_send_test.dart) for the `bestie` reply without a name. - No before/after captures: the change is in Siri's own UI, which can't be driven or recorded in the simulator. --------- Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz> |
||
|
|
34c8f5c7a5 |
feat(mobile): add Dart notification body formatter (#9556)
Adds a pure Dart function, `notificationBody`, that turns a message's Markdown content into the plain-text notification body defined by [ADR 0002](https://github.com/block/buzz/blob/main/docs/adr/0002-notification-message-text.md). It is a port of the Swift `BuzzPushNotificationResolver.previewBody` in `BuzzPushKit`, which today is the only implementation. Android notifications will be built from the app's Dart code, as in the [Android push design](https://github.com/block/buzz/pull/9555), and will reuse this function so the body reads the same on both platforms. Nothing calls it yet and the Swift side is unchanged. Notes on the port: - The cap stays at 256 UTF-16 code units, the same as iOS (the fixtures set `maxLength` to 256). - Dart's regex engine differs from the ICU one the Swift code uses (`\s`, `.` and `$`), so the patterns spell those out to keep identical results. Trimming also matches Swift's `whitespacesAndNewlines`, which trims U+200B and keeps U+FEFF, where Dart's `trim` does the opposite for both. - Truncation counts whole characters (extended grapheme clusters) via `package:characters`. ### Validation - A table-driven test runs every case in `test-fixtures/notification-body.json` (47 cases) and checks the fixture's `maxLength` against the function's cap. - Added tests: 8 rows in the shared fixture pin the ICU details the port must match. U+000B and U+0085 beside a marker keep it, U+000B and U+000C inside a run keep its markers, U+200B is trimmed at the edges and doesn't count toward the cap, and U+FEFF at the edges is kept. The Swift fixture test runs them too and passes them unchanged. - Proved falsifiable: with code-span and fence handling disabled, 18 fixture cases fail; restored, all pass. - `just mobile-install mobile-check mobile-test` passes. ### Regressions None: new code that nothing calls yet. The Swift formatter is untouched. Its fixture test now also runs the 8 new rows and passes them unchanged. --------- Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> |
||
|
|
5e8fa368a4 |
fix(mobile): hand message action menu scrolling off to sheet dismissal (#9760)
## Summary On mobile, the message action menu is a modal bottom sheet whose body scrolls when the actions overflow (long menus, large text sizes). Before this change, dragging down inside the body only scrolled or bounced the content: the sheet itself could be pulled down only by its handle. Now a downward drag in the body carries on into pulling the sheet down once the content reaches its top, in the same touch, and the sheet can be dismissed that way. - **Handoff in both directions.** Drag updates are split between the content and the existing modal route. Dragging down past the top of the content moves the sheet; reversing without lifting restores the sheet first and then scrolls the content again. - **Release policy is the stock sheet's.** If the finger has displaced the sheet at release, downward velocity strictly above 700 px/s closes it; otherwise it closes when it has been pulled more than half its height, and settles open if not. Where the gesture began, and whether it scrolled content on the way to the top, does not matter. - **Guards against accidental dismissal:** - a release with the sheet not displaced by the finger never closes; - ballistic and programmatic scrolling cannot start a sheet drag, so a content fling that reaches the top after the finger lifted stops there; - carried scroll momentum is not added to the release velocity; - a slow return across the top that pulls the sheet less than half way settles open; - an upward release velocity keeps the sheet open. - **Unchanged:** handle and barrier behaviour, reactions, cancellation recovery, reduced motion, and the action/focus contracts. The handoff lives in a shared widget, `mobile/lib/shared/widgets/modal_scroll_handoff.dart`; `message_actions.dart` changes by three lines to use it. `docs/mobile-message-action-scroll.md` records the design contract and a manual native checklist. ### Related issue N/A. None found (searched issues and PRs for the message action menu dismissal and scroll). ### Testing Run at `558a79710`: - `just mobile-check`: passed (format; analyze: no issues). - `just mobile-test`: passed (5462 Flutter tests, 71 skipped; 27 crypto tests). - `just file-size-check`: passed. - Restoring the previous release rule fails 12 of the updated tests, including all four message action journey variants. Coverage: the message action journey (2x text scale, iOS and Android platform settings) drives the production sheet with timed pointer events; the shared widget tests cover the release table at several scroll offsets, pointer flicks on both platforms, parity with the stock sheet drag around both thresholds, trailing bounce on short menus, cancellation and interruption. **Simulator recordings.** Both videos are side-by-side captures from the iPhone 17 simulator (iOS 27.2, text size `accessibility-large` so the menu overflows). Each side replays the same touch script. Scroll-to-dismiss handoff. Left: base (`9bcb3e45a`), the body only bounces and the sheet never moves. Right: branch at `23c31e2e1`, the same touches pull the sheet down, restore it on reversal, and dismiss it on a slow drag past half and on a flick. https://github.com/user-attachments/assets/09b0cfc2-ed61-4822-8b35-b80d0f47e830 Scroll up slightly, then swipe down hard. Left: `23c31e2e1`, the menu settles back open after both swipes. Right: `558a79710` (branch head), the same touches close it, as a new touch and without lifting; the final slow return across the top stays open on both sides. https://github.com/user-attachments/assets/068faff4-a4d4-478f-aaf4-fc65c644632f **Limits of this validation:** - The touches were scripted synthetic touch events (linear motion, exact timing), not a human finger. - Both sides ran a dummy-data harness that calls the production `showMessageActions` for a placeholder message, not the real channel page. The harness is not part of this PR. - Android, a physical device, VoiceOver and reduced motion were not exercised natively; they are covered by widget tests only. - The right side of the first video was built from `23c31e2e1`, one commit before the branch head. `558a79710` changes only releases with a fast downward velocity after content was scrolled. The gestures in that video are slow or held releases and gestures that start at the top, which resolve the same way under both rules; this follows from the release rule and was not re-recorded. - A human has not yet confirmed the behaviour by hand. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Matt Toohey <contact@matttoohey.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> |
||
|
|
8827f986e4 |
mobile: follow desktop's unified sidebar workspaces (#9745)
Mobile Home now reads desktop's unified sidebar from block/buzz-app#3791 and shows the same workspaces, filings, icons and section order as the desktop sidebar. It is read-only while a unified record exists. ## What changed - **Reads desktop's records.** Mobile reads `channel-workspaces` and `channel-workspace-sort`. Until the unified record exists, it falls back to the legacy `channel-sections` and Solo groups, merging them the way desktop imports them (`expandWorkspaceRecord`, `importWorkspaceFallback`, `mergeLegacyWorkspaces`). Sort follows desktop's `meta.g` registers. - **Layout.** Sections are Starred, then the workspaces, Team, Solo and Direct messages, in desktop's `sectionOrder`. A workspace holds Team channels and Solo chats alike, and shows its icon: Unicode emoji as text, `:shortcode:` as the community's custom emoji, and nothing for an unknown shortcode. - **Read-only lock.** While a unified record exists, mobile hides rename, delete, move, New project and sort edits, and never publishes the legacy records desktop would ignore. That includes: - an edit queued before the lock; - a unified head arriving during a relay rate-limit wait (`mayPublish`); - a Team publish whose preflight read failed; - a New project or workspace pick opened before the lock (the chat is still created, without the filing). - **Recovery.** A foreground refresh with a pending legacy sort still applies a missed unified head. - **No All/Solo/Team filter.** Desktop removed its tabs in #3791, since workspaces now hold Solo and team chats together, so Home drops its chips too. The Messages header keeps its title and actions and no longer collapses on scroll. - **Filters.** The Unreads filter uses Solo's own unread state for Solo rows. - **NIP-44.** Decryption accepts the extended length prefix for payloads over 65535 bytes. A nostr-tools vector is included. ## Tests - `workspace_layout_interop_test.dart`: a table generated by running desktop's TypeScript from buzz-app `main` (11 layouts and 10 invalid records). It checks that mobile computes the same sections, assignments and order. - `sidebar_workspaces_journey_test.dart`: Home runs on the real sections and sort notifiers over the relay fixture. It starts on legacy sections, receives desktop's signed heads live, then checks the order, filings, icon, read-only sheet and Unreads. It also checks that only the filter choice is published. - `unified_sidebar_records_test.dart`: Team and sort publish nothing once a unified head is seen: before an edit, while one waits, or past a failed preflight. - `project_creation_test.dart`: the unified layout arrives while a workspace is being named. Nothing is written, and nothing is left to resume. - `solo_creation_tags_test.dart` and `me_sync_test.dart`: a project picked or a filing queued before the lock doesn't stop a new Solo chat from being created. Each new guard was mutation-checked: removing it fails its test. `flutter analyze` is clean and `flutter test` passes (5450). ## Not in this PR (open questions) - **Forums** stay hidden on Home, as before. Desktop shows them, so a forum filed into a workspace or starred on desktop doesn't appear on mobile. Should mobile add a Forums section? - **Filters** still use the legacy `channel-filter` record. Desktop prefers `channel-workspace-filter`. - **Solo creation without a unified record** still writes the legacy Solo groups, as before. - **Empty workspaces** are shown, as on desktop. Mobile rejects a unified record that carries `meta` without `filings`; desktop never writes that shape. - Built-in titles now match desktop: "Team" (was "Channels") and "Direct messages" (was "DMs"). ## How to test 1. On desktop (buzz-app with #3791), create two workspaces, give one an emoji icon, and file a Team channel and a Solo chat into it. Reorder the sections. 2. Open mobile Home in the same community. The sections, order, icon and filings should match desktop. 3. Open a workspace's options. You should see only Sort (disabled) and Show. Long-press a channel: there's no "Move to section…". 4. There is no All/Solo/Team filter row under the Messages title. 5. Change the order on desktop. Mobile should follow live, or after you foreground the app. Screenshots are in the comment below. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Wes <wesbillman@users.noreply.github.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> |
||
|
|
bea77282da |
fix(mobile): open message actions only from a long press on the message (#9753)
## Why I find myself putting my finger down before scrolling and end up triggering the long press. Each time I think "but i wasnt touching anything?" ## Summary On mobile, the long-press recognizer covered the whole message row, so holding the empty space beside a bubble in a channel, DM or thread opened that message's actions. A hold now opens the actions only when it lands on a part of the message. - **Bubble and media:** a hold on the painted bubble or media opens the actions, as before. - **Other message parts:** the avatar, author line, edited marker, photo count label, reply footer and add-reaction button are marked as long-press targets around their own extent, so they still open the actions while the unused row width beside them stays inert. - **Empty space beside a message:** a hold there opens nothing and gives no haptic, and releasing it does not open the thread. A quick tap there still opens the thread. - **Unchanged:** swipe-to-reply still starts only on the bubble and media, and the screen-reader long press, the reaction tray's long press and the system rows' full-row hold behave as before. https://github.com/user-attachments/assets/2ede96b0-b9dd-49f3-926f-5cad32f7242e ### Related issue N/A. I searched issues and PRs for "long press" and found none for this; the closest is #8500 (action sheet opening while scrolling), which is a different problem. ### Testing Widget tests in `swipe_reply_tests.dart` cover a hold beside the bubble (no actions, no thread, no haptic, and a quick tap still opens the thread), a hold on each message part in channels and threads for own and other messages, attachment and gallery holds, the semantics long press, and that a swipe from the non-bubble parts starts no reply. Side-by-side recording on an iPhone 17 Pro simulator (iOS 27.2), `main` on the left and this branch on the right, running the same four 1.0 s holds at the same coordinates. The red ring marks the press point and was overlaid afterwards. Holding the empty space beside a message opens the action sheet on the left and nothing on the right; holding the bubble opens it on both sides. The recording was made at the first commit on this branch (`378dde654`), before the two follow-up commits, and uses a local relay with seeded throwaway data. It covers short messages from another author in a channel and a thread; own messages, DMs and media are covered by the tests only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Matt Toohey <contact@matttoohey.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Jitter <2b2e6415e748c35180847a37aadae06a11e30dddc76b784e7fd9354c4eb42e7a@buzz.block.builderlab.xyz> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> |
||
|
|
9bcb3e45a4 |
perf(mobile): hash upload payloads in bounded worker chunks (#9747)
Follow-up to #9736, which moved upload hashing off the UI isolate with `compute`. `compute(_sha256Hex, bytes)` copies the whole prepared payload into the worker while the uploader keeps the original for the PUT. For a 100 MiB attachment that adds about 100 MiB to peak memory before the first request. This streams the payload to a worker isolate in 1 MiB chunks, with one chunk in flight at a time (the worker acks each chunk before the next is sent). Each chunk is copied with `TransferableTypedData.fromList` on its own slice, since sending a `sublistView` would copy the whole backing buffer. The digest, the `X-SHA-256` header, the signed Blossom `x` tag and the cancellation checks are unchanged. ### Validation In a 100 MiB AOT probe, peak RSS was 114 MiB hashing inline, 214 MiB with the whole-buffer `compute` handoff, and 141 MiB with acked 1 MiB chunks, at about the same hash time (611 / 622 / 614 ms). Added tests in `mobile/test/shared/relay/media_upload_test.dart`: the worker digest matches `crypto.sha256` for a 2 MiB + 123 byte payload, sends three chunks with at most 1 MiB in flight, and handles an empty payload. ### Regressions - UI responsiveness: the hash still runs off the UI isolate. The UI isolate now does one 1 MiB slice copy per chunk instead of one full copy. - Latency: hash time is about the same as with `compute` in the probe. Small uploads pay one isolate spawn, as before. --------- Signed-off-by: Tom Brow <tomb@block.xyz> |
||
|
|
890824f072 |
feat(read-state): sync mark read, channel mark unread and thread follows (#9501)
Reading, mark read, whole-channel mark unread and thread follow choices now sync across a person's installations. This PR specifies the rules in NIP-RS and implements them in the mobile app. ## Spec (`docs/nips/NIP-RS.md`) - Defines *catch-up* and *displayed*. - A catch-up advances the channel's own frontier (top-level messages) or `thread:<root>`. `activity:` and `thread-activity:` become read-only legacy keys. - Explicit mark read is synchronized state. A first explicit read of a message with no override group writes only its `msg:` frontier. Display, dwell, scroll, catch-up and mention visibility create no `msg:` entries. - Only whole-channel override groups are published, merged and cleared with the counter. Readers ignore peer `msg:` and `thread:` groups. - Single-message and thread mark unread stay on the device. They end once the merged frontier covering them passes their baseline, from any installation, or on display, catch-up or explicit read. The section also states clearing scope, the accepted concurrency limitation and capacity. - When the merged override union no longer fits the primary, the client rewrites the primary compactly from the groups its last published primary carried, each canonical against current frontiers. It never omits merged groups or tombstone floors that primary carried, and override actions fail visibly. - Adds Buzz Thread Follow Choices: `thread-follows:<32hex>` coordinates, validation, three-state verdict, last-writer merge with ties going to unfollow, publication and recovery, legacy import at `at = 0`, and capacity. ## Mobile - Catch-up writes the main frontier. A flat timeline reads up to the newest top-level message it reached. - Explicit mark read publishes. Passive `msg:` marks stay on the device. - Whole-channel mark unread publishes an override group and merges peer groups. An explicit read or catch-up clears it, even when no frontier moves. The action fails visibly at the uint32 limit or when the primary is full. A synced clear the primary can't carry is rolled back, and the channel view reports it once while the failure stands. - Device-local message and Inbox unread overrides record a baseline and clear when a covering frontier passes it, including one merged from a peer. - Thread follows move from local storage to the synced `thread-follows:` slots. They share the read-state `client_id`, journal, `created_at` sequence, snapshot and live subscription, and spill across up to 16 slots with stable placement. An unreadable coordinate marks follow state incomplete and blocks this installation's follow publication. - Follow and unfollow are refused on every cold start of the writer until its first complete recovery of its own state succeeds and every owned follow head is readable. Cached follows show at once. A refused tap changes nothing and shows "Follow choices are not ready. Connect and try again." Reads, catch-up and both kinds of mark unread are not gated. - A follow tap is accepted only once journaled. The accepted own head, pending edits and the exact in-flight packet are kept apart, so a retry or restore never drops or re-attributes an edit. - Pre-sync local follows are imported at `at = 0` after a complete merge, once their channel is known from a relay event. An imported key is settled, and its legacy copy retired, only when the journal write the import awaited covered it and that entry is still current. - An explicit unfollow suppresses ordinary replies at live and catch-up admission. A change in follow choices drops the unread replies already counted for an unfollowed thread. A newly followed thread re-runs catch-up only for its own channel. - A reading clear refused because the view hasn't completely loaded is retried after the next complete snapshot, including when publishing was shut off at the time. The view also counts as not completely loaded while the live subscription is reconnecting, so a read made while the phone is offline can't erase a newer unread mark set on another device. Offline, whole-channel mark unread is still refused, with a message. - Read-state events, including live ones, are verified with native libsecp256k1 before they are used. - A pending unread packet is counted as published only when no newer own head outranks it. When a newer head supersedes it, a successor is built above that head from the saved intent, and a late echo of a replaced packet doesn't overwrite what was published. - When the merged unread state overfills the primary and the compact fallback can't carry a pending mark, the packet stays pending and the "read state full" error shows. Other queued reads and follows in the same flush still publish. - When this installation's own unread record can't be decoded, only the unread step is held: that record isn't overwritten, its pending marks stay queued and the sync error shows. Other queued reads and follows in the same flush still publish. - The sync notice stays up after an unsupported refusal until a new session. Offline, it can't be tapped and says it will retry when back online. - Two-device fixtures against an in-memory relay cover channel round-trips and clears, stray message groups, the first explicit message read, the primary cap, follow propagation, same-second and backward-clock follow publication, legacy import, retry after a failed publish, unreadable coordinates and slot packing. Recovery fixtures cover the startup gate, journal failures during flush, interleaved legacy imports, and restore of an older journal. ## Relay - Conforming `thread-follows:<32 hex>` records get the NIP-RS treatment: a replaced record is purged, and a stale resend of an older one is refused. Records with a mismatched `t` tag keep ordinary replaceable-event behavior. ## Known gap - An unread packet held for capacity can age past the relay's timestamp window. The relay then refuses it, and the refusal path retires it without the capacity check, so the error clears and other installations don't get that mark. The mark stays on the device. Related: [block/buzz-app#3552](https://github.com/block/buzz-app/pull/3552) --------- Signed-off-by: Will Pfleger <wpfleger@block.xyz> Signed-off-by: Will Pfleger <wpfleger@squareup.com> Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> |
||
|
|
cda68a9333 |
Fix shared stars and mutes in mobile and CLI (#9684)
## Summary Mobile, CLI, and legacy desktop write millisecond timestamps for new star and mute edits. They compare legacy seconds in the same unit and retain the original timestamps of untouched entries during rollout. Mobile and CLI cap saved records at 500 entries and repair oversized records on a write. CLI no-op adds and removes leave oversized records alone. They keep the current edits and evict by age, preferring clears when timestamps tie. The CLI accepts a full flag record within the short-form NIP-44 envelope. Mobile builds each write from the writer's retained snapshot plus a durable journal of local edits. The journal drains in batches of at most 500 edits. It retries transient failures and older writer snapshots with bounded backoff and retires a pending edit after verifying that the writer already holds it or holds a strictly newer one. Retried writes preserve the original entry timestamps. An exact timestamp tie with a conflicting writer value advances by one millisecond so older clients accept the edit. An unreadable record pauses writes until a valid snapshot or app resume. On mobile upgrade, a verified writer snapshot lets the app recover newer local star and mute edits from the old cache. The legacy cache has no edit journal. Below 500 writer entries, the app also recovers absent active flags. At 500 or above it only recovers absent active flags dated after the snapshot's creation second. Absent legacy clears and clears newer than the writer's recorded clear are kept locally. They enter the publish queue when an older or equal enable appears. If the enable disappears before preflight, the clear returns to the local cache. A newer enable, an equal or newer clear, or a fresh tap retires the saved clear. A cached enable is queued when it is newer than the writer entry or ties a writer clear. A strictly newer cached enable advances the timestamp even when both copies are enabled. Recovered enables and promoted clears keep their original stamps in the journal. When the relay entry is absent or uses seconds, the write keeps a recovered seconds stamp so a later edit from an older phone can win. An existing millisecond entry uses millisecond comparison and serialization for the recovered edit. ## Validation - Mobile regressions exercise a later seconds-stamped edit, two-device eviction, a pending clear at the cap across manager replacement, transient read recovery, a losing duplicate acknowledgement, and a second toggle during confirmation, including at the cap. - CLI regressions cover seconds-stamped entries, the 500-entry limit, recovery from oversized records, and clear retention, including a repeated remove that leaves active flags intact. - Runtime validation uses scripted relays. - All 702 CLI tests passed. - Pre-push gates passed, including the full Flutter suite and analysis, repository Rust tests, and desktop Tauri checks. - Legacy desktop tests cover mixed-unit merges and back-to-back toggles. Mobile upgrade regressions cover newer offline entries, eviction, reconnect, and malformed-head recovery. --------- Signed-off-by: Wes <wesb@block.xyz> Co-authored-by: Star Lord <b89298dbe87c6b3fd8a425b535d9d161f23c88d555a47925ae0b04dfe02b201e@buzz.block.builderlab.xyz> |
||
|
|
b7fb268e8b |
fix(mobile): keep active iOS Huddles connected while locked (#9682)
## Summary Locking an iPhone paused Buzz and ended the current Huddle. An admitted iOS Huddle now keeps its audio session and media connection through app pause and resume. Detaching the app or switching communities still ends local audio, and the main relay retains its normal pause policy. ### Related issue None found. The disconnect was reported while using the installed Buzz iPhone app. ### Testing - A Flutter regression joins a Huddle, pauses the app, lets the main relay’s background grace period expire, and resumes. The baseline left the Huddle. With the fix, the local session remains active and detach still stops media. The test uses fake media and transport. - The iOS simulator package and development-signed iPhone package both declare the background audio mode. An iPhone 15 Pro running the development build at `18db4d969494` stayed connected when locked. Two-way lock-screen audio and headset switching remain unverified. In a test Huddle, exchange distinct phrases in both directions with the phone unlocked, while it stays locked, and after unlock. Confirm that participation continues without rejoining and that Leave stops audio. - Before readiness, verify what peers see when the backgrounded app exits after its main relay disconnects, and what the iPhone shows on unlock after a prolonged media interruption. #### Screenshots Flutter Huddle card rendered with test data.   --------- Signed-off-by: John Tennant <jtennant@squareup.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Oliver <e78152627ea32fbacb070e5047afcfb8e409fa3343d9e618227baacca5b5e607@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> |
||
|
|
f7496607a8 |
fix(mobile): hash upload payloads off the UI isolate (#9736)
## Summary Move SHA-256 for prepared mobile uploads to a worker isolate with Flutter's `compute`, at all payload sizes. The same digest feeds the `X-SHA-256` header and Blossom authorization. The existing cancellation check runs before each HTTP send, including after the worker returns. ### Related issue No matching open issue or PR found. ### Testing - `just mobile-install mobile-check mobile-test` passed, including `flutter analyze` and the full Flutter suite. - The upload regression verifies that a 2 MiB attachment's `X-SHA-256` header matches the request body's digest. - The composer widget tests wait for the worker while exercising send, progress, cancellation, and error handling. - On Apple M3 Ultra, a host Flutter test ran the production prepared-byte upload path with a stub HTTP transport. Median delay to a queued main-isolate timer over three runs: | Payload | Before | After | | --- | ---: | ---: | | 50 MiB | 330 ms | 3.6 ms | | 100 MiB | 644 ms | 7.5 ms | At 100 MiB, the patched isolate serviced at least 40 callbacks from a 16 ms timer before HTTP send. The baseline serviced zero. Both produced the same hash. This measures host isolate responsiveness. ### Manual check On a phone, attach a large file in a test conversation. Tap Send and immediately scroll the conversation. Scrolling should stay responsive during upload preparation. Open or download the completed attachment and verify that it matches the original. Signed-off-by: Wes <wesb@block.xyz> Co-authored-by: Rocket <0c41329ade659e01801116549bc617351689892a382bc864a1186dc9191293a7@buzz.block.builderlab.xyz> |
||
|
|
9bc5740012 |
fix(mobile): stop notification extension sending cookies to Builderlab (#9741)
Builderlab's hosts set Cloudflare's `__cf_bm` cookie on every response. The notification extension's sessions are `.ephemeral`, which keeps an in-memory cookie store, so after the first response every later request to Builderlab sends the cookie back. The NIP-FI assertion issuer refuses any request carrying a `Cookie` header with 401 `session_required`, so the extension's assertions fail and notifications from communities that require NIP-FI fall back to "Open Buzz to view this message". - `BuzzRelayAssertionIssuer` now turns off cookie storage and sending (`httpCookieStorage = nil`, `httpShouldSetCookies = false`) on the configuration it uses for both the identity-binding check and the assertion request, whatever session it is given. - The extension's per-notification relay session gets the same settings, since the relay is also a Builderlab host. - The issuer gains a `startDownload` seam, matching `BuzzNotificationAvatarLoader`'s, and a `BuzzPushKitTests` test checks that the assertion request carries no `Cookie` header after the identity check's response sets one. Signed-off-by: Will Pfleger <wpfleger@block.xyz> Co-authored-by: Duncan <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@buzz.block.builderlab.xyz> |
||
|
|
4079793f99 |
Match desktop unread cues on mobile channel rows (#9715)
## Summary - Honor the synced `seen:<channel>` timestamp in mobile row styling and the **Unreads** filter. Attention keeps its dot regardless of timestamp, and the row's mark-read menu uses the underlying unread state. - Hide the dot when the row shows a mute the relay has confirmed. Confirmation survives reconnects within the same account and relay. The row still exposes unread attention to screen readers. Unmuting on the phone restores any dot supported by retained unread evidence as soon as the bell disappears. - Apply the same `seen:<channel>` timestamp to the app icon badge's ordinary backlog count. Mentions and thread replies keep counting. Includes #9721. This reuses the existing read-state and mute sync. Pending mutes keep the dot visible, and the patch adds no relay requests or read-state writes. ### Related issue No matching issue or open PR found. Earlier mobile sidebar unread parity work is in #1303. ## Testing - `just mobile-install mobile-check mobile-test` - Widget coverage for backlog at and after the desktop cut, mentions on either side of it, the **Unreads** filter, the mark-read menu, pending and confirmed mute, and unmute while the relay still reports muted. - Scripted relay coverage for mute confirmation across reconnects, delayed and older responses, newer confirmations, and relay switches. Read-state tests cover reading a peer's `seen:` context during an ordinary mobile publish. - Badge provider tests cover backlog at and after the cut, plus mentions and thread replies older than the cut. ### Test on a phone with desktop alongside 1. Check out the PR. To install a local debug build, run `./scripts/mobile-worktree-overrides.sh` from the repo root, then run `flutter devices` and `flutter run -d <device-id>` from `mobile/` with Hermit active. Use the device signing setup if needed for a physical iPhone. Sign in to the same account and community on both clients. Use an already initialized mobile account and leave the phone on the channel list. [Device signing setup](https://github.com/block/buzz/tree/main/mobile#ios-push-capability) 2. Have a second account post an ordinary message in a test channel. Wait for its row to become bold on both clients. On desktop, open that channel and switch away quickly, before the 300 ms reading dwell. After sync, the phone row should lose bold. In the phone's section menu, choose **Filter…**, select **Unreads**, and tap **Apply**. The row should disappear. Use **Show hidden channels** and long-press the row to verify that **Mark Read** is still available. Dismiss the menu, tap **Hide filtered channels**, and have the second account send a newer ordinary message. The row should appear bold again. 3. For a mention older than the cut, have the second account @mention you in a different test channel before making the quick desktop visit. After leaving the channel on desktop, the phone should still show its attention dot. For a newer mention, do the quick desktop visit after an ordinary post in a separate channel, wait for its phone row to quiet, then send the @mention. Its phone row should gain a dot. 4. With the mention still unread, mute that channel on desktop. When the phone shows the muted bell, verify that the attention dot disappears. Turn off the phone's network connection, return to the channel list, then reconnect. The dot should stay hidden throughout. On the phone, long-press the row and choose **Unmute channel**. The dot should return as soon as the bell disappears. Keep the phone on the channel list throughout so it does not read the mention. 5. On a phone with app badges enabled, repeat the ordinary-message case in step 2 with that message as the only unread item. After the phone syncs the desktop visit, the app icon badge should clear. A newer ordinary message should bring it back. Device and desktop testing is pending. ### Before and after Before and after captures from the Flutter channel list widget with synthetic rows. The ordinary `desktop-seen` row loses bold, the confirmed-muted mention loses its dot, and the unread control stays bold. | Theme | Before | After | | --- | --- | --- | | Light |  |  | | Dark |  |  | --------- Signed-off-by: Wes <wesb@block.xyz> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Star Lord <b89298dbe87c6b3fd8a425b535d9d161f23c88d555a47925ae0b04dfe02b201e@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> |
||
|
|
286095c937 |
feat(mobile): refresh Huddle speaking styles and iOS controls (#9716)
## Summary Bring mobile Huddle speaking indicators closer to desktop with a close, avatar-colored ring and subtle portrait motion, respecting reduced motion. Use native Liquid Glass for full-screen iOS controls with clear microphone/speaker active states; preserve the minimized sheet. Regular iPhone and Android controls retain their existing positions and sizes. Duo uses a side rail with End Call above minimize, microphone and speaker below, consistent spacing, and extra cover-display status clearance. Participants remain centered across the full display width. Hide the emoji action while retaining reaction support for a future return. ### Related issue No matching open issue found. Earlier mobile control exploration: #9383; invitation changes are outside this PR. ### Testing - Static analysis and pre-push checks passed at `bc5eb34f4`. - Full mobile suite: 5,126 passed; companion suite: 27 passed. - Coverage includes speaking-ring geometry, reduced motion, glass selected states, both Duo rail sides and display sizes, standard-phone control geometry, and minimizing to the original sheet. - Physical Duo previews reviewed during iteration; final build installed on iPhone Air for owner testing. Owner approved proceeding to PR. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> |
||
|
|
03336d0872 |
fix(mobile): only say "Community changed" when the community changed (#9156)
On mobile, a text send that failed for almost any reason showed **"Not sent. Community changed."** The composer caught every `StateError` as a community switch, and relay failures such as a briefly disconnected socket (`RelaySession.publish` throws "Relay session is not connected") are also `StateError`s. So a reconnect blip during a send told the user they had switched communities when they hadn't. The community-switch guards in message, forum and channel-action delivery now throw a dedicated `ActiveCommunityChangedError`, and an unconnected publish throws `RelayNotConnectedError`. Both still extend `StateError`, so every existing `on StateError` caller behaves as before. The composer now reports: | Failure | Message | | --- | --- | | Active community changed mid-send | Not sent. Community changed. | | Relay socket not connected | Not sent. No connection. | | Relay never acknowledged the event (ack timeout) | Not confirmed. The relay didn't respond. | | A relay request timed out before the event was published (e.g. a roster lookup) | Not sent. The relay didn't respond. | | Connection lost after the event was sent, before its acknowledgement | Not confirmed. Connection lost. | | Relay rejected the event, or anything else | Not sent: *relay reason or error text* | The two "Not confirmed" cases may still have been accepted by the relay, so they avoid a definite "Not sent" that would invite a duplicate resend. Pending publishes rejected by a disconnect or backgrounding now complete with a typed `RelayAckLostError` instead of a generic exception, and an unacknowledged publish times out with `RelayAckTimeoutError` (still a `TimeoutException`) so it can be told apart from earlier timeouts. The draft is restored in every case, as before. ### Validation - Added [composer widget tests](https://github.com/block/buzz/pull/9156/files#diff-101740841aadcb902d0717f3909debe16073c672e73be74a5b908bf11dfc8782) for each non-community failure (disconnect, timeout before publishing, ack timeout, connection lost before acknowledgement, relay rejection, other `StateError`), checking the snackbar text, that the draft is restored, and whether the message EVENT was sent. The disconnect, timeout and connection-lost cases run through the real relay session (a pending publish rejected by backgrounding, a history request that times out before any message EVENT). The existing community-switch journey goes through the real channel-action guard. - Simulator (iPhone 17 Pro, debug build of this branch signed in to a test community): opened a channel and sent a message; it was delivered and the composer cleared normally. Limitation: the error paths themselves were exercised only by widget tests, since the simulator shares the Mac's network and I couldn't drop the relay connection for it alone. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Tom Brow <tomb@squareup.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> |
||
|
|
42b89f9b5f |
fix(mobile): align Huddle cards and preserve conversation navigation (#9713)
Hide generated private Huddle rooms from mobile channel lists, including cached rooms and older rooms with creator-matched creation receipts. Ended Huddle cards keep **View** available while membership is unknown. Known non-members see disabled **Ended**. Unknown membership is checked with the relay before opening history, and explicit access denials clear cached transcript rows. Opening history never joins audio. Known members can reopen loaded history offline. Already-authorized history stays mounted through a disconnect or transient revalidation failure while the route remains open; reconnects recheck access, and explicit denial clears it. Rooms without sufficient evidence remain visible. Match desktop card colours, borders, 20-point corners, elapsed duration, participant avatars and ended-call icon. Active cards retain headphones and mobile tap targets. Replace the minimized Huddle's full-app UIKit background with Flutter clipping: the native background caused the two-pane iOS conversation to appear blank even though its messages were loaded and scrollable. The owner reproduced the failure and confirmed the Flutter surface restores the timeline on iPhone Duo. Lifecycle updates share one live subscription and merge into history. Start/end discovery has its own query budget and survives a failed participant-history read; avatar rosters use revision and admission metadata for same-second reconnects. Explicit denials propagate without trying a fallback transport. Creation receipts coalesce overlapping list refreshes and reconcile after the list loads, retain verified classifications in scoped snapshots, and stop sending batches after a community switch. Removed the unused native backdrop and bottom-corner options. Validation on `7f1a278dbe`: 5,133 Flutter tests plus 27 companion tests passed (71 skipped), analyzer and file-size checks passed, and the iOS release build passed. The updated Buzz Huddles preview is installed on iPhone Duo. The phone locked before launch, so the exact-revision native journey is still pending. Regressions cover cached-history denial, live-only lifecycle events across recovery, busy-call discovery, same-second rejoining, slow and overlapping receipt lookups, cached classifications, community switching, and HTTP denial with a transient WS failure configured. Both transport-denial and overlapping-refresh regressions were verified failing before the fixes. Tom’s follow-up from #9719 adds held-revalidation, known-member offline reopen and partial-roster failure coverage. The original blank-screen fix was verified by the owner on iPhone Duo; this review revision still needs their on-device minimized-Huddle/two-pane and VoiceOver checks. The surface retains Flutter's existing 24-point shape instead of iOS-adaptive concentric corners. ### Snapshots Synthetic widget previews; no private conversation data. | Active | Ended | Dark mode | | --- | --- | --- | |  |  |  |  --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> |
||
|
|
1ac0b1dad1 |
Match mobile mention chips to desktop styling (#9706)
Mobile mentions now use the desktop chip treatment: neutral rounded pills for other identities, the chat accent for mentions of the viewer, and a contrasting inset fill inside outgoing messages. This applies to message bodies and compact previews, while preserving profile taps and resolving self-highlights by public key. The change reuses the existing chat palette and keeps it stable across parent rebuilds, so unchanged messages retain their parsed Markdown. Mention routing and composer behavior are unchanged. Validation: `just mobile-check mobile-test` passed (5,118 Flutter tests, 71 skipped, plus 27 crypto-package tests). Coverage includes light/dark themes, 2× text, profile taps, live identity switching, outgoing contrast, and Markdown reuse; removing self-highlighting makes the regression fail. A signed iOS build was installed and checked on a physical device, then approved for PR preparation. ### Snapshots Actual Flutter component renders with synthetic identities and the bundled app font. Each shows received/own messages, compact previews, and enlarged text. | Light | Dark | | --- | --- | |  |  | buzz-review-completed Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> |
||
|
|
7361326717 |
fix(mobile): keep glass controls mounted and the wide thread push parallax (#9726)
Fixes three regressions that #9717 (Duo chat switching) introduced. **Glass controls blank when anything covers their route.** #9717 gated `IosGlassNavigationButton` and `IosGlassNavigationAction` on `useNativeRouteControlsVisible`, so every glass control (Home's filter chips, glass Back, Close, Done) unmounted under any dialog, alert or modal sheet and during every push, pop and back swipe, then came back as a new platform view near the end of the transition. This drops the gate from those two widgets, which restores their behaviour from before #9717. The problem #9717 targets is unaffected: under Search and Activity sheets the hook already returns true and the opaque backing hides the controls. Home's gate, the Channels route sync and `IosMessageCreateButton` keep the hook. **The visibility hook rebuilt its host on every animation frame.** It subscribed to the route's animation values but only reads whether the covering animation is at zero and whether the route is reversing. It now uses `useListenableSelector` on those two booleans, so a host rebuilds only when visibility can change. **A wide thread push lost the outgoing chat's slide.** For an immediate wide selection, `_ConversationDetailRoute.buildTransitions` returned its child directly, which also discarded the secondary animation that moves the chat left when a thread is pushed over it. It now builds the platform transition with a completed primary animation, so selection stays immediate and the covered chat keeps its parallax. ### Regressions - Glass controls go back to staying mounted under covering routes, as they did before #9717. Platform-view bleed under non-sheet routes is therefore the pre-#9717 behaviour, not new. - No change to compact navigation or to the Search and Activity sheet composition. ### Validation Added tests: - [native_route_controls_test.dart]( |
||
|
|
bf1cd5500d |
fix(mobile): stabilize Duo chat switching and sheet layering (#9717)
## Summary Selecting a chat or channel in the expanded conversation layout now switches immediately, while opening a deeper thread keeps its navigation animation. The selected chat reuses the native iOS header and blur surface so switching conversations does not flash; each conversation still owns its own editor and timeline state. Search and Activity now slide as opaque sheets over stationary native controls, revealing them progressively on dismissal. Activity keeps its existing title styling with Close in the Duo rail; expanded Search gains top spacing. Compact navigation and the transparent toast composition path are preserved. ## Validation - Final head `bd92c40e86`: full mobile suite 5,132 passed, 71 skipped; 27 crypto tests passed. Required push checks passed. - Native iOS suite: 115 passed. Formatting and analysis clean. - Header-retention regression fails with the retention key removed and passes after restoration. - Recorded repeated native-header switches in a wide iPad simulator fixture, plus Search/Activity transition checks in the Duo simulator. - Owner verified both sheet motion and chat switching on the physical Duo. The final ordinary-iPad Activity guard is covered separately by tests. ## Snapshots Synthetic chat fixture using the actual conversation-pane routes and UIKit header on an iPad simulator. These illustrate two consecutive selections; they are not screenshots of the owner's chats or the Duo rail geometry. Recorded transition frames were also inspected for continuous blur. | Design selected | Mobile selected | | --- | --- | |  |  | --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> |
||
|
|
83eb59c631 |
fix(mobile): keep open shared sessions in Solo (#9704)
Sharing a Solo session as View only changes its access to open. Mobile incorrectly required private access to recognize Solo, moving these sessions into Channels. Recognize labeled Solo streams independently of visibility, retaining their existing project placement and membership/ownership checks. Apply the same rule to iOS notification classification so reply routing agrees with Flutter. Add regression coverage for open owned/shared Solo sessions and exclusion from Channels. This changes presentation only; access settings remain unchanged. Validation: mobile-install and mobile-check passed; Solo regressions passed in the full Flutter run (5,095 passed, 71 skipped, one failure in community_provider_test.dart: startup and credential replacement discard orphan snapshots and image caches). All 81 BuzzPushKit tests passed. Independent agent review completed with its notification-routing finding fixed. Device workflow and human testing remain pending. To verify: share a Solo session as View only, reopen mobile, and confirm it remains in its Solo project and is absent from Channels. Verify notification replies return to the same conversation. Follow-up to #9348. Pre-push rerun: analysis passed, but the Flutter compiler ran out of disk space and the stalled test process was interrupted. The hook subsequently returned success after 27 crypto-package tests passed; that is not a full Flutter pass. The earlier complete Flutter result above remains the applicable evidence. Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> |
||
|
|
68d367cf23 |
fix(mobile): align channel indicators and Duo section menus (#9703)
Align the mobile channel-list indicators to one trailing column. The unread dot stays at the right, with the temporary clock and mute indicator to its left when present. Duo's native menus for built-in and custom sections now place their ellipsis in the same 20-point slot while preserving the full 44-point tap target and native menu behavior. Validation: full mobile suite (5,098 passed, 71 skipped), 27 crypto tests, clean Flutter analysis, native UIKit menu geometry/hit-target checks, and a successful iOS release build. Installed on iPhone Air and Duo using existing saved state; inspected the Duo's native section-menu placement. Regression coverage checks row alignment, clock ordering, native bridge geometry, and the full menu hit area. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> |
||
|
|
7d116da335 |
fix(mobile): allow person mentions in Solo chats (#9705)
## Summary Mobile Solo rejected a human member mention with “Not sent. Community changed.” because it checked every recipient for agent ownership. Explicit mentions now accept current chat members, matching desktop; the implicit header agent still requires ownership. Fresh membership and community checks remain in place. This improves human-only and mixed person/agent sends without changing default agent selection, nonmember invitation rules, or thread drafts. It also fixes existing private shared Solo chats. ### Related issue Separate follow-up to #9704; no dependency on its classification change. Searched open issues/PRs: #9156 addresses misleading send-error wording and #9699 addresses mention editing; neither changes this Solo recipient ownership check. ### Testing `just mobile-install mobile-check mobile-test` passed (5,122 Flutter tests, 71 existing skips; 27 crypto package tests), along with `just file-size-check` and diff checks. Regression coverage drives the actual composer on iOS and Android and checks explicit-recipient removal/community-switch boundaries, plus existing implicit-agent ownership checks. Before the fix, the new composer journey retained the human-mention draft on both platforms. Manual check: in an owned shared Solo with a human member, send an explicit mention of that person, then a mixed person/agent mention. Each should send and clear its draft. Untagged messages should still use the selected agent. Native device/live-relay testing and human confirmation remain pending; this PR stays draft under AGENTS.md. Signed-off-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> |
||
|
|
8306e38742 |
fix(mobile): let code scroll under the code block copy button (#9612)
## What changed The copy button on a message code block reserved a fixed 40px column beside the horizontal scroller, so every line was clipped about 40px short of the block's right edge. This was most visible on narrow phones. The fix matches buzz-app desktop (`Markdown.module.css`, `.codeActions`): - The horizontal scroller now spans the whole block. - The copy button floats in the top-right corner on an opaque chip, so code scrolled under it never collides with the icon. On an own-message bubble the chip is the code tint blended over the outgoing fill, so it matches the block. - The end padding moves inside the scroll content, so every line end can still be scrolled clear of the button. - The language label keeps its right inset, so it never runs under the button. ## Why nothing gets worse Same tap target, icon, copy behavior and block insets. The only visual change is that code now uses the width the gutter used to take. Long lines in the button's row pass under the opaque chip while scrolled, as they do on desktop. ## Testing - `message_content_test.dart` "renders code block with language tag" now asserts that the scroller spans the block inside its border and that the copy button overlaps the scroller. Without the production change it fails (`Expected: 798.0, Actual: 746.0`), and it passes with it. - Before/after captures were rendered with the real fonts and the mobile appearance theme at iPhone width, for received and own (Chartreuse) bubbles, at rest and scrolled to the end. They are in the screenshots comment. - Pre-commit and pre-push hooks passed. - Not yet exercised in the native app on a device. The iOS "Copy and Delete" screenshot paste issue from the same report is still being diagnosed and is not in this PR yet. 🤖 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> |
||
|
|
5bd9d2c5d2 |
Transcribe Bestie hold recordings into text on device (#9645)
Hold Bestie to record with the waveform and slide-up cancel interaction from #8665, then release to send an on-device transcript as a normal text message. Stay on Home with a loader inside Bestie until delivery succeeds, then open chat. Failures expose Retry/Discard; saved recordings and signed messages remain recoverable without duplicate sends. Saved audio is excluded from OS backup. Existing composer voice notes are unchanged. Separate exploration from #8665. Transcription requires iOS 26 and a supported language. Android reports unavailable before capture because its generic recognizer cannot guarantee saved-file input. Validation: at `b5dc83bbf5`, 5,046 Flutter tests (71 skipped), 27 crypto tests, analysis and required push checks pass. Prior native changes at `30a397f83c`: Android build and 33 tests pass; iOS simulator compilation and backup-exclusion test pass, with one unchanged document-picker timeout passing on isolated rerun. Earlier iPhone preview was tested with saved profile preserved; these latest fixes have not been installed on the physical phone. --------- Signed-off-by: kenny lopez <klopez4212@gmail.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> Co-authored-by: corey <2dafccf60ea6d431a568f6d67fc600160d92a51e415e09dc8b213b8e360663d5@buzz.block.builderlab.xyz> |
||
|
|
39ffc3dcc5 |
fix(mobile): keep agent poster up until the iOS video draws (#9688)
On iOS, an animated agent avatar (a preset character with a transparent
video) blinks out for one to three frames right after navigation
settles. Opening a Solo chat blanks the header avatar; going back to
Messages blanks the bestie bubble.
The cause is the hand-off from the still poster to the video. While a
route animates, `PresetAgentAvatar` shows the poster; once it settles it
replaced the poster with a native `AVPlayerLayer`, which draws nothing
until its first video frame arrives. The avatar picker and the
create-agent page already covered this by passing a preloaded poster;
the DM and Solo header and the bestie bubble pass none, so they went
straight to the bare player.
Now every iOS caller gets that hand-off, using its own poster when it
passes none: the poster stays up, below the player, until playback
advances in that showing, then fades out over 160 ms. The poster sits
below the native layer rather than over it, because a Flutter overlay
above a platform view also costs a blank frame when the view first
appears. Each showing starts covered again and waits for playback to
advance from where the player actually is, so coming back to a chat from
a page above it doesn't blink either. The poster is keyed by its URL, so
when the avatar changes to another character (for example a synced
bestie change) it never shows the previous character's poster. Android
is unchanged; it already waits for a presented frame.
### Validation
Measured on an iPhone 17 Pro simulator, recording at 60 fps and checking
the avatar region frame by frame, opening a Solo chat with an animated
agent and going back:
| | Header blank on open | Bubble blank on back |
| --- | --- | --- |
| main, 3 runs | 1 frame every run | 2 to 3 frames every run |
| this PR, 3 runs | none | none |
Before (left) and after (right), slowed 4x: the Solo header on open,
then the bestie bubble on back.
<video
src="https://github.com/user-attachments/assets/4ddf16c0-bb8d-4d77-b53e-84f83ff45e98"
width="480"></video>
Added test: [iOS keeps the poster over a new player until playback
advances](
|
||
|
|
fd436af846 |
feat(mobile): add saved channel section filters (#8479)
**Category:** new-feature **User Impact:** Mobile users can filter each channel section by unread or recent activity and save their choices to their account. **Problem:** Mobile sections do not expose the account's saved All, Unreads and Active filters, making long channel lists harder to navigate on mobile. **Solution:** Add per-section view settings with shared sheet chrome, checked choices, inline Active duration and Apply/Cancel. Preserve access to filtered channels through inline recovery and confirm encrypted filter writes on relay readback. **Known desktop and web sync limitation:** Mobile uses the encrypted `channel-filter` record. The separate current desktop and web build reads and writes `channel-workspace-filter` and falls back to the legacy record only before a workspace filter exists. Once the workspace record exists, filter changes are independent across the builds. The interoperability tests below cover the older companion format from [block/buzz-app #1297](https://github.com/block/buzz-app/pull/1297). Current desktop and web interoperability is follow-up work. <details> <summary>File changes</summary> **mobile/README.md** Document section controls, recovery and preference behavior. **mobile/lib/features/channels/channel_filter/channel_filter_activity.dart** Read verified message activity with bounded concurrency and lifecycle/live invalidation. **mobile/lib/features/channels/channel_filter/channel_filter_manager.dart** Preflight, publish and confirm encrypted preference changes, retaining rollback and errors. Skip no-op deletion cleanup and allow best-effort cleanup after local section removal. **mobile/lib/features/channels/channel_filter/channel_filter_provider.dart** Scope preference ownership and cache to the current account and relay. **mobile/lib/features/channels/channel_filter/channel_filter_store.dart** Preserve companion-compatible registers, durations, reset tombstones and unknown fields; define filter predicates and salvage malformed supported-v1 siblings from authenticated relay records. **mobile/lib/features/channels/channels_page.dart** Connect the filter owners and shared sheet header to channel navigation. **mobile/lib/features/channels/channels_page/body.dart** Apply filters using the same readiness predicate as unread highlights, retain the selected channel and expose activity retry. Delete sections locally before best-effort filter cleanup. **mobile/lib/features/channels/channels_page/filters.dart** Provide one draft settings sheet with checked rows, duration, pending guards and retry. Announce retained-draft failures in a visible live region beside the footer. **mobile/lib/features/channels/channels_page/sections.dart** Open section options directly and reveal hidden channels in the existing roster. **mobile/lib/features/channels/channels_provider.dart** Invalidate activity for self-authored and muted messages independently of unread state. **mobile/test/features/channels/channel_filter/channel_filter_test.dart** Cover record preservation, confirmed writes, malformed sibling repair and the actual activity-provider/predicate composition, including future-dated history. **mobile/test/features/channels/channels_page_test.dart** Cover staged saves, cancellation, failed drafts, saved duration and read-only recovery at enlarged text. **mobile/test/features/channels/channels_provider_test.dart** Verify self-authored activity invalidates filters without changing unread timestamps. **mobile/lib/features/channels/channel_sections/channel_sections_provider.dart** Emit local deletion immediately so offline removal updates the list without waiting for a relay event. **mobile/test/features/channels/channels_page_test/filter_feedback_tests.dart** Verify pre-seed unread consistency and offline section deletion through the real section provider and persistent storage, without filter publication. **mobile/test/features/channels/channel_filter/channel_filter_interop_test.dart** Exercise encrypted desktop/mobile golden payloads and crossed writes that converge on one complete winning record. **mobile/test/fixtures/channel_filter_desktop.json** Retain signed, encrypted synthetic-key payloads from the companion desktop implementation and mobile manager for protocol regression coverage. </details> ### Reproduction 1. Open a channel section's options. Select Active and 7 days, then Apply; reopen to see the saved choices checked. 2. Confirm older channels are hidden. Expand Show hidden channels to navigate without clearing the filter. 3. Change a draft and Cancel. Confirm the saved filter remains unchanged. 4. With preferences unavailable, delete an unfiltered custom section. It should disappear and remain deleted locally without publishing a filter reset. 5. Make a filter save fail. The draft should remain selected and the error should be visible beside Retry and exposed as a live region. ### Validation and limits - Follow-up fixes at `f38bf9b273402dd86e93476dde02f468747fa65a`, with main `a93f3282c` integrated. Required pre-push checks passed on that head: 3,742 Flutter tests passed, 16 skipped; four unconfigured-push tests passed. Analyzer, formatting, file-size and branch-skew checks passed. - Repaired v1 metadata now contains exactly `v` and `g`, preserving unknown top-level extensions. The pinned companion at `475e2afef` verified, decrypted and adopted the repaired mobile head without rewriting it. Sort-only Apply preserves late-loaded filters and publishes no filter write; the existing signed-read sheet journey covers this race. - Affected pre-integration journeys/protocol tests: 97 passed. Removing the production fixes produces six failures across unread readiness, offline deletion, malformed siblings, activity classification and accessible failed-save status; sources restored afterward. - Protocol exercise: actual `block/buzz-app` browser-host filter code at `475e2afef` produced the signed NIP-44 desktop golden head; the mobile manager adopted it and published a sibling choice; desktop decrypted/adopted that mobile write and preserved both durations on its next edit. These are production-code exercises with synthetic keys and a fake relay boundary, not two packaged clients exchanging against a live relay. - Whole-record last-write-wins applies to both mode and duration. Preflight preserves observed sibling choices; crossed writes can overwrite an unseen edit, even in another section. Readback checks the requested pair, and refresh adopts the retained winner. Per-section conflict-free merging is not promised. - Supported-v1 malformed siblings are salvaged from the authenticated relay head, with canonical repair published only by an explicit confirmed save. Oversized records and unsupported schema versions remain read-only; display cache never grants repair authority. - Section deletion is local first. Unfiltered sections skip publication; failed cleanup can leave unreachable settings for a never-reused section ID. No offline filter-save queue or automatic cleanup retry is introduced. - Earlier iPhone 17 / iOS 26.5 testing exercised section options, Cancel/reopen and Active/7-day filtering. The normal-flow screenshot below predates these review fixes. Failure-path runtime/screen-reader checks, Android, dark mode, packaged cross-device workflow and human acceptance remain unverified. - Preferences refresh on load/resume/pull-to-refresh; no instant cross-device sync promise. Sort retains its existing asynchronous persistence and is not atomic with the separate filter record. - On `85949bcde`, 5,095 Flutter tests passed with 71 skipped, plus 27 secp256k1 tests. GitHub's required checks cleared. The duration animation was tested on the iPhone 17 simulator against a local relay, and the same animation is included in this head. The separate non-required Codex Security Review run was canceled before publishing a review. ### Screenshots Actual iOS simulator capture, cropped to the section settings surface. | Section view settings | | --- | |  | --------- Signed-off-by: Taylor Ho <taylorkmho@gmail.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz> |
||
|
|
b544fcea4a |
feat(mobile): add a diagnostics test report and test crash to Settings (#9676)
A way to check that a build's diagnostic reporting works end to end, per
[mobile diagnostic
reporting](https://github.com/block/buzz/blob/main/docs/mobile-diagnostic-reporting.md).
A build with a reporting destination shows a Diagnostics card in
Settings with **Send test report** and **Test crash**. A build without
one, which includes every build from this repository alone, never shows
it and still reports nothing.
| Before | After |
| --- | --- |
| 
| 
|

### What's in it
- The reporter gains `reporting` (whether the build has a destination),
`sendTestReport()` and `crashForTest()`. The do-nothing reporter returns
false and does nothing.
- **Send test report** sends a fixed `DiagnosticTestError` tagged with a
new `testReport` operation. It passes through the same filter as every
report.
- **Test crash** asks for confirmation, then crashes in native code
through the SDK, so native crash reports can be checked too. The report
goes out the next time the app opens.
- The spec gains a "A way to check a build" decision.
### Regressions
None expected: builds without a destination render Settings exactly as
before.
### Validation
Added widget tests for the card being absent without reporting, sending
a test report, and the crash happening only once confirmed, plus a test
of what a sent test report contains and one that a second tap sends a
second report. The screenshots come from simulator builds of main and
this branch, both with the same placeholder destination.
A full-app simulator run at
|
||
|
|
bf9ce1432e |
feat(mobile): add diagnostic reporting module with crash capture (#9613)
Step one of [mobile diagnostic reporting](https://github.com/block/buzz/blob/main/docs/mobile-diagnostic-reporting.md), first piece: the reporting module, plus capture of crashes and uncaught errors. A build given a `BUZZ_SENTRY_DSN` now reports native crashes, Flutter framework errors and uncaught asynchronous Dart errors to that Sentry project, attributed to the signed-in member's public key. A build without one (every build made from this repository alone) uses a do-nothing reporter and never initializes the SDK, as [ADR 0007](https://github.com/block/buzz/blob/main/docs/adr/0007-diagnostic-reporting-follows-the-destination.md) requires. A destination the SDK cannot parse is treated as none, so a configuration mistake never stops the app from starting. ### What's in it - **One interface** in `mobile/lib/shared/diagnostics/`: report an error, count a networking event, leave a breadcrumb, and set the member. It has a Sentry-backed and a do-nothing implementation. Only this folder imports the SDK. The explicit error reports and the networking counts that use it come in the next PRs. - **Startup** wraps `runBuzzApp` and installs the SDK's crash and error handlers only when a usable destination is set: one with an HTTP(S) host, a public key and a project, which the native SDKs also require. On Android, the manifest removes the SDK's startup performance provider, which would otherwise run before that check. - **Member:** set from the active community's key, changed when the account switches, cleared on sign-out. Adding the Builderlab origin and account subject is left to a later PR. Every report also carries a random per-install identifier the app creates on first launch, as its own `install.id` tag, signed in or not, so a device's reports can be matched to its members. It lives in a file that device backups and transfers skip, so a phone restored from another gets its own: on Android in the app's files directory, excluded in both backup rule sets; on iOS in an Application Support folder that a small native call marks as excluded from backup (not the caches folder, which iOS can clear when storage runs low). Set on the SDK scope, it also reaches native crash and hang reports. With no member set (before sign-in or after sign-out), the SDK also fills the report's user with its own random per-install identifier, on Dart and native reports alike. - **One filter** runs on every Dart report, breadcrumb and count before it leaves the device: - It replaces every error's own text with fixed wording, since an error can quote its input, a server's response body or a URL. The error keeps its type, mechanism type and stack trace. - It drops what the SDK adds about the failing platform call (`mechanism.data`) and the failing widget (`flutter_error_details`), which can quote what is on screen. - It removes URL query strings and fragments, and keeps only tags and count attributes on the allowed list. - It drops every breadcrumb except networking events and the SDK's foreground/background entries. - **SDK options:** personal data, screenshots, view hierarchy, replay and tracing stay off. The SDK's session records stay on, for a crash-free rate. A session begins each time the app starts or returns after 30 seconds or more in the background; the SDK sends a record when it begins, an update each time an error is counted, and a last one when it ends, carrying the start time, error count, outcome, time from start to end, release, environment and the random per-install identifier. Native auto-breadcrumbs, Android's network-change breadcrumbs (VPN state, signal strength, bandwidth; turned off in the manifest, since the Flutter bridge leaves them on), Cocoa's network breadcrumbs (which keep each request's query and reach native crash reports) and print breadcrumbs are off. With print breadcrumbs on, the SDK would replace `debugPrint` in non-debug builds with one that prints nothing. - **Main-thread hangs:** iOS app hang tracking, Android ANR detection and iOS watchdog-termination tracking are set on explicitly, at the SDK's default thresholds. iOS reports the main thread blocked, fully or mostly, for 2 s or more while the app is active, including freezes it recovers from; a hang still going when the system kills the app is sent on the next launch as a fatal hang, and watchdog-termination tracking reports a foreground run that ended with nothing else to explain it. Android reports only system-declared ANRs: on Android 11 and later, the most recent one that ended the process (read on the next launch, when the system kept a thread dump); before 11, after 5 s once the system marks the app not responding. So recoverable freezes are reported on iOS, and on Android only before 11 once the system marks the app not responding. Dart runs on the main thread, so blocking Dart work shows up with the main thread's stack; Dart frames need the Dart debug symbols at the destination, as crashes do. The spec now has a bullet and a user story for this. - **What the filter does not cover:** native crashes and app hangs are captured and sent by the native SDKs, which never call the Dart filter. They carry stack traces and, for a native exception, its reason text. No app code puts content in a native exception today. The spec now says this. - **Reporting never blocks the app or reaches it with an error:** every call returns at once, and a failure inside reporting is dropped with a `debugPrint`. ### Regressions None for builds without a destination, which includes every build from this repository: they run the same startup with one extra synchronous check, and the SDK is never initialized. The SDK still adds to the app's binary size on both platforms. With a destination, the first frame waits for the SDK to start, native SDK included, and for the install ID to be read from (or, on first launch, written to) a small file. On a debug simulator build the first frame came about 0.3 s later (median of 6 cold launches: 768 ms with a destination, 431 ms without), measured before the install ID was added. Device builds will differ. Uncaught errors still reach Flutter's default handling, and the SDK sends in the background. ### Validation Added tests (`test/shared/diagnostics/diagnostic_reporting_test.dart`): - A table of inputs run through the production Sentry options callbacks: SDK HTTP and navigation breadcrumbs are dropped, network breadcrumbs keep only their four attributes, URLs lose their query string and fragment, unknown tags and count attributes are dropped, and the privacy and breadcrumb options stay off. - Errors sent through a real SDK hub, with the SDK's own platform-error processor and Flutter error integration, into an in-memory transport: for a parse failure, a bad argument, a server response and a platform failure, the serialized event keeps the type and stack but none of the error's text; a real framework build error leaves out the widget text. - A release-mode check that `debugPrint` keeps printing with reporting on. - A build with no destination, one the SDK cannot parse, one without a public key or one without an HTTP(S) host starts the do-nothing reporter and the SDK stays disabled. - Reporting calls whose SDK calls throw, either synchronously or asynchronously, never reach the caller. - Hang detection is on and its thresholds equal the SDK's defaults. - An installation keeps one install ID across launches, a new installation gets a new one, and the filter keeps the `install.id` tag. - Signing in, switching accounts and signing out change the member that later reports are attributed to. I checked that each guard is real by removing it: the print-breadcrumb setting, the destination check, the error-text replacement, the `mechanism.data` and `flutter_error_details` removal, the network-breadcrumb setting, the dropped-failure catch and the tag filter each made a test fail. End to end on an iPhone 17 Pro simulator, with a local server standing in as the destination and a throwaway probe (not committed) that made an HTTPS request with a secret in its query, then raised an uncaught Dart error and a framework error with secrets in their text, then crashed natively: - All four reports arrived (two Dart, one framework, one native crash on the next launch), and none of the secrets appeared in any envelope. - Dart reports carried only the foreground/background breadcrumb; the native crash carried none. - As a control, a build with Cocoa's network breadcrumbs switched back on put the request's secret query and fragment into the native crash report, so that setting is what keeps them out. - `debugPrint` lines still appeared in the device log. Hangs, on a fresh iPhone 17 Pro simulator with no debugger attached and the same local server: a throwaway probe busy-looped the main isolate for 5 s after the first frame. The SDK sent an `App Hang Fully Blocked` event ("App hanging between 5.7 and 6.5 seconds", mechanism `AppHang`) carrying the main thread's stack: Flutter engine frames around 12 frames of Dart code. This was a debug build, where Dart is compiled just in time, so those frames have no image to symbolicate against; in release builds they fall in the app's compiled Dart framework and need its debug symbols at the destination. Install ID, rechecked after moving it to its own file, on a fresh simulator with the same local server, launched twice with a probe that raised a Dart error and then crashed natively: both Dart errors and the native crash carried the same `install.id`, while the signed-out user was the SDK's own identifier. The ID file was in the backup-excluded `Library/Application Support/Diagnostics` folder, not in the app's preferences. The merged Android debug manifest has neither of the SDK's startup providers and has the network-change setting off. The NDK preload provider is still merged in, but it does nothing unless its own manifest flag is set, and it isn't. Full mobile suite passes. Dart errors are captured in the main Flutter engine only; the iOS sheets that start their own engine are out of scope for this PR (native crashes while they are open are still caught), as the spec now says. iOS simulator and Android debug builds with a destination set both build; on iOS the SDK resolves through Swift Package Manager. --------- Signed-off-by: Tom Brow <tomb@squareup.com> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost> |
||
|
|
b624eb0f20 |
fix(mobile): recover stuck read-state updates and stale Mark Read (#9492)
## Summary Mobile read-state fixes within the current NIP-RS text. - **Stuck pending update.** When the relay refuses a pending update with `invalid: event timestamp too far from server time` and the update is older than the relay's 15-minute window by the device clock, the update is retired. The next pass reads a fresh snapshot and sends a strictly newer successor, journaled before it is sent, unless the relay already holds that update or an own-slot update covering every key in it. The marks come from the journaled local state, so nothing is lost. A refusal of an update that is not old by the device clock reports `ReadStateClockSkewError` and keeps the exact signed bytes. Unknown outcomes (timeouts, lost acknowledgements) still retry the exact bytes. - **Mark Read from the channel actions sheet.** The sheet is the only owner of the action, for custom-section channels too. It marks through the newest message known at the tap (the listed `lastMessageAt` or a newer observed unread event), not the `Channel` captured when the menu opened, so messages arriving after the tap stay unread. With no known message time it only releases forced-unread flags. - **Failed snapshot.** A failed snapshot, during startup or inside a publish, retries with backoff (5 s doubling to 5 min) while connected and on app resume; the retry re-syncs and sends journaled marks. When a publish's own snapshot read succeeds first, the pending retry is cancelled, the backoff resets to 5 s and the superseded snapshot error is cleared. A reconnect still re-syncs as before. The channels list shows a tappable "Unread status isn't syncing" notice while sync is failing. - **Marks in the manager gap.** A mark, seed or forced unread made after a dependency change retired the manager, but before the rebuild, now runs the pending rebuild and reaches the current manager instead of being dropped. The session-wide publishing switch-off after an unsupported-kind or missing-scope refusal is unchanged: marks stay journaled and the next manager (restart, re-authentication or community switch) publishes them. In that state the notice offers no retry and says to sign in again or restart Buzz. ## Tests - `read_state_manager_test.dart`: expired update with only partial coverage is renewed with a newer successor carrying every mark; expired update the relay already holds is retired with no new send; clock-skew refusal keeps the exact update and reports the skew error; failed snapshot retries on the backoff timer and stops after recovery; a snapshot failure inside a publish retries on its own and sends the marks; after an explicit flush whose snapshot read succeeds, no extra snapshot is read and the next failure retries after 5 s, whether the write succeeds or fails. - `channel_actions_sheet_test.dart`: Mark Read covers a message that arrived while the sheet was open; with no known message time it only releases forced unread. - `read_state_provider_test.dart`: a mark made between a community switch and the next manager's build is kept. Each new test fails without its fix. --------- Signed-off-by: Will Pfleger <wpfleger@block.xyz> Signed-off-by: Tom Brow <tomb@block.xyz> Co-authored-by: Hayt <211b96e6a2b7f45fd4047988976c7bbbeeda0c15f3ae7b32eec20834b5a55118@buzz.block.builderlab.xyz> Co-authored-by: Tom Brow <tomb@block.xyz> |
||
|
|
c18bed1f46 |
fix(mobile): name the cause of account-unavailable sign-in errors (#9628)
## Problem Organization sign-in can fail with `Couldn't sign in (account-unavailable)`. That code covers several different failures, so a screenshot can't tell them apart: - the account server can't be reached at all (DNS, connection, or TLS failure, or a timeout), for example when a required VPN profile isn't applied to the app; - a redirect, since the client doesn't follow redirects, so an access-proxy login page lands here; - a 5xx from the server. ## Change - `BuilderlabAccountClient` records why a request failed as `unavailable`, in `lastUnavailableCause`, and logs it. It follows the existing `lastRejectedRequest` pattern. The cause is one of: - a transport category: `unreachable`, `insecure`, `timedOut` (reusing `transportFailure`), or `network` as the fallback; - the status code, such as `http302`. - `OrganizationSignIn` saves the cause at the moment the exchange fails, so later account requests can't change it. It adds the cause to the failure code, for example `account-unavailable-http302` or `account-unavailable-unreachable`. Each new attempt clears it. - The organization sign-in page now ends its failure message with advice for that cause instead of "Try again.": - unreachable, timeout, TLS failure, redirect: "Check your network or VPN connection, then try again." - a 5xx: "The sign-in service is unavailable. Try again later." - The in-app banner keeps "Try again.": its capsule clips longer messages at default text size, and the existing banner layout test caught that. - Unexpected statuses are classified as soon as the headers arrive, so a slow or oversized error body can't hide the status. | Before | After | |---|---| |  |  | The log line contains only the host, route, and cause. It has no headers, credentials, or response bodies. ## Validation - A new journey test in `organization_sign_in_test.dart` covers an exchange that fails with a 302, a 503, and a client exception, then a successful retry. With the cause capture removed, the test fails (`Expected: 'account-unavailable-http302'`, `Actual: 'account-unavailable'`). - The same test checks the advice for each cause. The internal-build landing tests pass with `--dart-define=BUZZ_DISTRIBUTION=internal`. - The screenshots come from the real `PairingPage` rendered in a scratch widget test with a 390×844 surface, cropped. The scratch test isn't committed. - `just mobile-check` passes, and the full `flutter test` run passes: +5018, 71 skipped. - Not yet done: a device run that reproduces an unreachable account server and captures the new message on screen. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Diem Nguyen <diem@squareup.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
3689241672 |
feat(mobile): reply to a message from its iOS notification (#9439)
On iOS, a notification that shows a channel or DM message now offers
**Reply**. The user types a reply in the notification and sends it
without opening the app.
- The reply goes in a subthread under the notified message (its thread
root is the message's own root, or the message itself when top-level). A
Solo chat takes no thread replies, so there it goes at the chat's top
level.
- It always mentions the notified message's sender, so the person or
agent being answered is notified. Typed `@name` text stays plain, since
a notification has no mention autocomplete.
- It is sent by the app's own send path. iOS starts the Flutter engine
when it wakes the app in the background, and the reply reopens the relay
connection (closed after the background grace period), waiting a bounded
time for it before sending.
- A sent reply marks the conversation read **up to the notified
message** (newer messages stay unread) and clears that notification and
earlier ones from the same conversation.
- An unsent reply (offline, relay error, timeout, a channel the user
isn't in) keeps the typed text as a draft, after any draft already
there, and shows a "Reply not sent" notification that opens the
conversation.
For now only notifications from the community selected in the app offer
Reply: replying must not switch communities, and the app can only reach
the selected one. Forum posts and fallback notifications that show no
message offer none. The design and the options considered are in
`docs/adr/0004-notification-reply.md`.
### Before / after
Long-pressing a message notification (synthetic names and text). Before
has no reply field (captured by sending the notification without its new
reply category, which is how main presents it); after shows one with
Send.
| Before | After |
| --- | --- |
|

|

|
### Demo
With the app backgrounded past the relay grace period, replying from the
notification lands the reply in a subthread under the message:
https://github.com/user-attachments/assets/37df7e28-aa46-4521-938e-8af5faa77b83
### Regressions
Nothing existing changes unless the user taps Reply. Notifications gain
a category and a small reply context in `userInfo`; tapping a
notification still opens the conversation as before. The relay reconnect
only happens for a pending reply and then falls back to the normal
background disconnect, so idle background behavior and network use are
unchanged. Reply failures end in a draft and a "Reply not sent"
notification rather than touching other state.
### Validation
- End to end on an iOS 27 simulator against a real community: with the
app backgrounded past the relay grace period, replied from the
notification; the reply appeared in a subthread under the message,
mentioning its sender. The demo above was recorded before the review
fixes (session hold, community fence, origin-community drafts, composer
draft sync); the same run was repeated on the current head,
|
||
|
|
a5b3dbc00d |
fix(mobile): stop reporting saved images as failed on iOS (#9599)
On iOS, **Save image** in the image viewer reported a failure for a save that worked. It asks only for permission to add photos. With that permission the image landed in Photos, but the app showed "Could not save image" and iOS then asked for full library access. After choosing **Keep Add Only**, every later save did the same: saved, and reported as failed. Now the save reports what actually happened, and add-only permission is all it needs, so iOS never asks for full access. | Before | After | | --- | --- | | <img src="https://github.com/user-attachments/assets/5926b595-6a2d-4382-83e5-89329c009159" alt="Before: full access prompt over a "Could not save image" message" width="300"> | <img src="https://github.com/user-attachments/assets/3b797c3e-43c4-4766-950b-8bef415ae2e0" alt="After: "Saved to Photos" message" width="300"> | Before: https://github.com/user-attachments/assets/e4f88b29-cabc-4c43-9967-d8481e434551 After: https://github.com/user-attachments/assets/ca3631a5-c988-4082-898a-426867788051 ### Cause `photo_manager`'s `saveImage` returns the saved asset, so its iOS code fetches the new asset back after writing it. PhotoKit does not let an add-only app fetch assets: the fetch makes iOS show the full-access prompt and comes back empty, and the plugin reports an error for a write that succeeded. The latest release (3.12.0) has the same code. On iOS the image is now written by a small native saver (`PhotoLibrarySaver`) that creates the asset and reports the result of that write, without reading the library. Android keeps using `photo_manager`, and the permission request is unchanged on both platforms. ### Regressions None expected. - The write is the same PhotoKit creation request the plugin made, with the same original filename, so saved images are unchanged. - Real failures still show "Could not save image": a denied permission, a failed download and a failed write all still surface. - Android and the rest of the app's photo library use (the composer's photo picker) are untouched. ### Validation - Added test: the image actions journey saves on iOS with a photo library that grants add-only access and rejects every read, and expects "Saved to Photos", one write with the downloaded bytes and filename, and an add-only permission request. A failed write then shows "Could not save image". It fails without the fix. - Full mobile suite and the iOS Runner unit tests pass. - Full-app run on an iOS 27 simulator, on a fresh install with no photo permission, comparing this branch with unmodified `main`: - `main`: first save adds the image, shows "Could not save image" and the full-access prompt; a second save after **Keep Add Only** adds another copy and shows the error again. - This branch: first and second saves each add one image and show "Saved to Photos", with no full-access prompt, and only add permission is granted afterwards. - This branch, other paths: **Don't Allow** shows "Could not save image" and saves nothing; saving with full access already granted works; **Share image** still opens the share sheet. - Not covered: a physical device, and Android (its code path is unchanged). --------- Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: judge <7615ec4b7ddf99f0bb48e913297f99f8f772d289a1c9ef54e1d906dd55a93ba8@buzz.block.builderlab.xyz> |
||
|
|
a26eacde49 |
perf(mobile): save own thread interest once per unread catch-up (#9614)
iOS was killing the app with watchdog terminations (`0x8BADF00D`, "scene-update watchdog transgression" and "Failed to terminate gracefully") because the main thread spent 5 to 10 seconds in unread catch-up. Symbolicated reports from a 1.4.0-rc.1 user all point at the same stack: `UnreadCatchUp._catchUpUnreadEvents` → `ChannelsNotifier._writeThreadInterestStores` → `jsonEncode` / `SharedPreferences.setString`. For every self-authored event in a catch-up batch whose thread was new to the interest sets, the notifier re-encoded **both** whole root-id sets and wrote both to SharedPreferences. That is quadratic in the batch: a fresh sign-in, whose catch-up returns many of the user's own messages, ran thousands of growing encodes and platform-channel writes on the main thread. Now the catch-up adds the whole batch to the in-memory sets and saves once if anything changed. The live single-event path is unchanged (one write per new thread). ### Regressions None expected. The persisted keys, format and contents are identical; only the number of intermediate writes changes. The storage contract is unchanged: saves were and still are fire-and-forget `setString` calls, so neither version guarantees durability before a process kill. A kill before the save lands now loses the whole batch rather than a prefix of it; a later catch-up can re-add those threads only while they are still after the channel's read timestamp and within the catch-up window. ### Validation - **Writes per catch-up**, 50 own messages across 50 threads: 50 writes per key before, 1 after (new test). - Added test: `unread catch-up saves own thread interest once per batch` (channels_provider_thread_interest_cases.dart). It checks the saved sets and the write count; it fails on the old code. - Full mobile check and test suite pass. - Automated full-app run on an iOS simulator (PR head build, signed in to a real community): cold launch and unread catch-up saved both thread-interest sets; background and foreground; Activity rows and unread dots render; opened a thread and sent a reply, and the participation set grew by one (live path still saves). No errors in the app log. Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: Tom Brow <tomb@squareup.com> |
||
|
|
148585c804 |
build(mobile): link iOS plugins through Swift Package Manager (#9597)
## Summary The iOS app stops opting out of Flutter's Swift Package Manager integration. The 19 iOS plugins that ship a Swift package are now linked through it. The three that don't (`google_mlkit_commons`, `google_mlkit_selfie_segmentation` and `open_filex`) keep installing through CocoaPods, which Flutter supports side by side. Why now: - CocoaPods is winding down: its spec repo [becomes read-only on December 2, 2026](https://blog.cocoapods.org/CocoaPods-Specs-Repo/), and plugin releases have started to ship as Swift packages only. Staying opted out pins those plugins at their last CocoaPods release. - The opt-out dates from the Flutter 3.47 upgrade (#8419), which kept the existing CocoaPods integration. With it removed, the app builds and runs as before. What is in the diff: - `pubspec.yaml`: the opt-out is removed. - `project.pbxproj` and `Runner.xcscheme`: the edits Flutter's own tool makes on the first build with the integration on (a local reference to its generated plugin package, and a scheme pre-action that prepares the Flutter framework). They are committed so a build does not dirty the tree. - `Podfile.lock`: only the three CocoaPods plugins and their dependencies remain. No Dart code, plugin version or remote Swift package changes. All 19 packages resolve to local paths in the pub cache, so `Package.resolved` is untouched and builds fetch nothing new. ### Related issue N/A. No existing issue or PR for this was found. ### Regressions - **App behavior:** the same plugin code at the same versions. The 19 plugins are linked statically into the app binary instead of embedded as dynamic frameworks, which leaves fewer libraries to load at launch and a slightly smaller app (numbers below). One resource bundle is lost; see the second accepted tradeoff. - **Extensions:** the notification service extension links no plugins, so it is unchanged. - **Build and release:** CocoaPods is still required for the three remaining plugins, so the Podfile, its post-install steps and the release tooling are unchanged. The first build after this change spends about 17 extra seconds adding the integration. - **Accepted tradeoff, build warning:** Flutter now prints a warning naming the three plugins without Swift packages. It goes away when those plugins add support or are replaced. - **Accepted tradeoff, one privacy manifest dropped:** the app no longer bundles `app_badge_plus`'s privacy manifest, and Xcode prints `Invalid Resource 'Resources': File not found` for it. Version 1.2.10's Swift package looks for `Resources` under its source directory, but the manifest sits at the package root, so the Swift package bundles nothing where the podspec bundled it. This is harmless: that manifest declares only UserDefaults access, and the plugin's single source file never touches UserDefaults. The other 16 plugin privacy manifests are still in the release app. Fixing it means a plugin bump, which is left out of this PR. - **Android:** unaffected. ### Validation Unsigned release build, this branch against unmodified `main`: | | `main` | This branch | | --- | --- | --- | | App size | 87.0 MB | 85.6 MB | | Embedded frameworks | 31 | 12 | Focused existing validation: the three iOS steps CI runs (simulator debug build, the 116 native `RunnerTests`, and the unsigned release build) pass locally. Full-app run on an iOS 27 simulator (iPhone 17 Pro), driven by an agent, with the debug build from this branch installed over an existing signed-in install: - The app stayed signed in and loaded its channel list and message history (keychain, preferences and local storage plugins). - Photo library picker, attaching a photo, and sending a video, which uploaded and played back. - Image viewer, the share sheet, and saving an image to Photos. - The file picker, and the camera and microphone permission prompts. - A link in a message opened in the browser, and a `buzz://` deep link reached the app. Two failures showed up and both reproduce identically on unmodified `main` on the same simulator, so neither comes from this change: a recorded voice note is empty because the host Mac has no microphone, and saving an image adds it to Photos but then reports "Could not save image". Limits: no physical device run. Camera capture, QR scanning, selfie segmentation and biometric prompts cannot be exercised on a simulator. Voice note playback was not exercised. Human testing is waived for this PR under the author's standing policy for mobile changes; the agent-driven run above stands in for it. Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: Tom Brow <tomb@squareup.com> Co-authored-by: judge <7615ec4b7ddf99f0bb48e913297f99f8f772d289a1c9ef54e1d906dd55a93ba8@buzz.block.builderlab.xyz> |
||
|
|
ff652ed06c |
perf(mobile): cache and animate custom emoji in the iOS picker (#9479)
The iOS emoji picker's custom emoji downloaded again every time the
picker opened, and animated emoji showed only their first frame.
Now each custom emoji downloads once per install and plays its
animation:
- The native picker gets image bytes from Flutter through the same path
as the rest of the app's images: the in-memory custom emoji cache, then
the persistent media disk cache, then one download through the shared
media HTTP client. Relay media is cached as immutable.
- Swift decodes every frame (no Swift-side cache) and shows the image in
a `UIImageView`, since SwiftUI `Image` draws only the first frame of an
animated `UIImage`. With Reduce Motion on, it shows the first frame,
following the setting live.
- At most four picker downloads run at once, and an emoji scrolled off
screen before its turn never starts. Emoji already saved on disk skip
the queue, so reopening a large set stays instant.
- A picker load joins any download of the same image already in flight
elsewhere in the app. A saved copy that fails to decode is evicted and
downloaded again, and only bytes that decoded are kept in memory.
- Swift decodes at most four emoji at once, including ones from cached
bytes. An emoji whose cell scrolls away gives up its place and stops
decoding between frames, and a cell that leaves the screen keeps only
its first frame.
- Each animation frame keeps its own delay. UIKit spaces animated frames
evenly, so a frame repeats for its share of the loop, and a GIF that
holds its last frame for 3 s still does.
### Why it refetched
The native picker loaded images itself with `URLSession.shared` and an
`NSCache` keyed on the whole request. Every request carried a freshly
signed media auth header, so the key never matched and nothing was
cached on disk.
### Validation
Relay media downloads for the 48 custom emoji matching "nod" (local
relay, iPhone 17 Pro simulator):
| Step | main | this PR |
| --- | --- | --- |
| First open | 48 | 48 |
| Leave and re-enter the channel, reopen | 48 | 0 |
| Relaunch the app, reopen | 48 | 0 |
| Reinstall the app, reopen | not measured | 0 |
Before (main): every reopen downloads again, and animated emoji are
still.
https://github.com/user-attachments/assets/7a43dd6a-61e0-495d-abed-6c11f7d4f965
After (this PR): reopening shows cached emoji immediately, and animated
emoji play.
https://github.com/user-attachments/assets/bf45a5c0-77ef-4501-8843-6f42e15de389
Automated app run: signed in to a local relay, opened a channel,
long-pressed a message, opened the full picker, searched, closed, left
and re-entered the channel, reopened, relaunched and reopened. Repeated
on the final head (
|
||
|
|
1059d81fc2 |
fix(ios): end each bold or strikethrough run at its first closing marker (#9559)
Bold and strikethrough runs in iOS push notification bodies now end at their first closing marker, so a message with two bold runs on one line shows both without their markers. Before, the run's optional group was greedy and stretched to the last marker on the line: | Message | Before | After | | --- | --- | --- | | `option **A** or option **B**` | `option A** or option **B` | `option A or option B` | | `~~x~~ and ~~y~~` | `x~~ and ~~y` | `x and y` | | `**😀** and **b**` | `😀** and **b` | `😀 and b` | The fix makes that group lazy (`(?:.*?\S)??`). Found while reviewing the Dart port in [#9556 Dart notification body](https://github.com/block/buzz/pull/9556), which must match these fixtures. That PR takes the same pattern once this one lands. ### Validation - Added tests: three shared rows in `test-fixtures/notification-body.json`, one per row above. All three fail with the old pattern. - All 70 BuzzPushKit tests pass on macOS, including the other 36 fixture rows, which are unchanged. ### Regressions None expected. The pattern still needs non-space characters right inside both markers and still stays on one line. It now stops at the first closing marker where before it reached for the last one. The output changes only where a one-character run is followed by the same marker later on the line, for example `**a** costs 2**3`, which was `a** costs 23` and is now `a costs 2**3`. Worst-case time for unclosed markers is unchanged (measured during review of the Dart port). Signed-off-by: Tom Brow <tomb@squareup.com> Co-authored-by: Tom Brow <tomb@squareup.com> |