Skip to content

Merge upstream 95dd9d67d (11.11.) into customizing/cschroeder - #9

Merged
cwschroeder merged 15 commits into
customizing/cschroederfrom
sync/upstream-20261111
Nov 11, 2026
Merged

cwschroeder merged 15 commits into
customizing/cschroederfrom
sync/upstream-20261111

Conversation

@cwschroeder

Copy link
Copy Markdown
Owner

Holt block/buzz main von 44b3c4823 (09.11.) auf 95dd9d67d (11.11.): 14 Commits, keine Migrationen.

Backend-Änderungen

Alle anderen Commits betreffen die Mobile-App.

Merge

  • Konfliktfrei.
  • Die Fork-Anpassung in handlers/auth.rs ist unverändert: Transiente DB-Fehler schließen die Verbindung mit NOTICE statt AUTH OK false.
  • Cargo.toml und Cargo.lock sind unverändert.

Tests

Läuft noch auf Studio 2: buzz-relay, buzz-pubsub und buzz-core mit dem festgelegten Rust 1.98.1, clippy und die Postgres-Spur. Ergebnisse folgen als Kommentar.

Deployment

Nicht live. 04498c170 (PR 8) wird zuerst allein ausgerollt, weil es die Migrationen 69 bis 86 enthält. Dieser PR folgt danach als reiner Tausch der Binaries.

🤖 Generated with Claude Code

loganj and others added 15 commits November 10, 2026 07:02
## Summary

Mobile showed "(edited)" only in the author header. A grouped follow-up
message has no header, so an edited follow-up had no marker at all. This
ports the placement from desktop
block/buzz-app#2020 to the channel and thread
message bodies:

- **After prose:** the marker joins the last line, for example `Hi how
are ya. (edited)`. This includes a final list item or quote, as on
desktop. It is drawn in the timestamp style, with the metadata colour on
received messages and the bubble ink on your own messages.
- **After a block that text cannot join:** the marker goes on its own
line inside the same text bubble. This applies to code, tables, rules,
display math, indented code, a heading, a last line that ends in a link,
and a bare list, quote or checkbox marker. A link renders as a widget
span, so a joined marker would be read before the link by screen
readers. Any body that contains ```` ``` ```` always uses its own line.
gpt_markdown's fence rules differ from CommonMark, so putting the marker
inside the Markdown could change how the code renders.
- **After trailing images:** the marker goes below the gallery, outside
the bubble.
- The marker is injected only at render time: a private-use slot
character that the renderer removes from authored content first. Copy
text, previews and notifications still use the original message content.

**Out of scope:** the mobile forum models (`ForumPost`, `ThreadReply`)
have no edited state and don't fold edits, so forum posts still show no
marker. Search and inbox previews also show no marker, which matches the
preview rules.

### Related issue

Desktop parity for block/buzz-app#2020. I found
no existing mobile issue or PR for this.

### Testing

At `5276d968`:

- `just mobile-check`, `just file-size-check` and `just mobile-test` all
exit 0.
- `edited_marker_test.dart`: a table test of which endings join inline
and which take their own line, including `` ```npm install``` ``, `~~~`,
indented code, tables, rules, math and bare block markers.
- `message_content_bubble_cases.dart`: rendered widget checks. For each
risky ending, the edited render is the unedited render plus one
`(edited)` line inside the same text bubble. The tests also cover
colours, trailing media, an open `<u>` and authored slot characters.
With the guards removed, this test fails.
- `channel_detail_page_test.dart`, edit journey: an edited message and
an edited grouped follow-up are marked and an unedited message isn't.
Copy text copies `Edited text` without the marker. Opening the thread
marks the edited head and the edited reply. With the thread wiring
removed, this test fails.
- Contrast (from review): received 5.34:1 light and 8.61:1 dark;
own-bubble accents at least 4.60:1.
- Android emulator run (screenshots below): every edited case shows the
marker where the rules above say, in light and dark. Not done: iOS
simulator and VoiceOver.
- Found during the emulator run, not caused by this PR: an edit made to
a thread reply before the thread is opened is not loaded, so the reply
shows its original text and no marker. The thread query asks only for
content kinds, and the channel history did not supply the earlier edit.
An edit that arrives while the thread is open shows correctly
(screenshot).

**Android emulator** (debug build of `5276d968` on a local relay, seeded
with edited messages):

| Prose, grouped follow-up, own bubbles, list | Code block, table,
fenced inline text, trailing image |
| - | - |
|
![emu-1-prose](https://raw.githubusercontent.com/block/buzz/673534d3aab0a87148655e19142965dbfdb6e3ef/pr-8863--emu-1-prose.png)
|
![emu-2-blocks](https://raw.githubusercontent.com/block/buzz/673534d3aab0a87148655e19142965dbfdb6e3ef/pr-8863--emu-2-blocks.png)
|

| Dark | Dark, trailing image | Thread (edit arrived while open) |
| - | - | - |
|
![emu-3-dark](https://raw.githubusercontent.com/block/buzz/673534d3aab0a87148655e19142965dbfdb6e3ef/pr-8863--emu-3-dark.png)
|
![emu-5-dark-media](https://raw.githubusercontent.com/block/buzz/673534d3aab0a87148655e19142965dbfdb6e3ef/pr-8863--emu-5-dark-media.png)
|
![emu-4-thread](https://raw.githubusercontent.com/block/buzz/673534d3aab0a87148655e19142965dbfdb6e3ef/pr-8863--emu-4-thread.png)
|

**Widget renders** (throwaway test, not committed):

| Light | Dark |
| - | - |
|
![edited-light](https://raw.githubusercontent.com/block/buzz/6a790edaaaa80acff4ed4a358be92e5ca8f86e25/pr-8863--edited-light.png)
|
![edited-dark](https://raw.githubusercontent.com/block/buzz/6a790edaaaa80acff4ed4a358be92e5ca8f86e25/pr-8863--edited-dark.png)
|

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…typed (block#9311)

## Problem

Add members (and New DM, which shares the picker) showed an empty list
until the first character was typed. An empty query runs no directory
search, so the only candidates were the viewer's own agents and agents
shared with them. Once those are members, or while the owned-agent list
is still loading, nothing is left.

`@` completion shows the channel's members before a name is typed. A
recipient picker has no channel to draw from, so this lists the people
the viewer already knows instead.

## Change

- With an empty query, `recipientCandidatesProvider` adds people from
the viewer's open channels and DMs (from the member lists the channel
list already loaded). Add members skips the target channel's own members
before choosing. The 50 people (`mentionSuggestionLimit`) are gathered
from DMs first, then channels, and shown in the usual label order.
- Empty-query rows list agents ahead of known people, so people never
push an agent off the 50-row list. When an agent the opening hasn't
offered yet arrives after rows were shown (the viewer's own agents
loading late, a picker opened mid-reload, or a reconnect that brings a
new agent), the people rows start over so it takes its place ahead of
them; agent rows already shown keep their places, including one whose
list is still reloading. A reload that brings no new agent moves
nothing, and typed rows never restart. Known people don't wait for the
agent lists, which never load offline.
- Member lists carry no profiles, so the unnamed people among the 50 are
loaded through the user cache's batched preload, each person once per
picker opening regardless of rebuilds.
- The roster scan stops at 50 people or 2,000 roster entries, whichever
comes first, and doesn't copy rosters.
- Typed queries and `@` completion are unchanged: same ranking,
directory search only, no known-people rows mixed in.

## Why nothing gets worse

- Network: at most 50 profile reads per opening, batched, only for
uncached people, and never repeated on rebuilds (new messages, presence,
profile updates).
- CPU: at most 2,000 roster entries per rebuild, only while a picker
shows an empty query.
- Agents: every agent the picker listed before still lists, ahead of the
new rows.
- Ranking, selection, typed search, the viewer and unshared-agent
filters, and "Add members hides existing members" are unchanged.

## Validation

- Added tests: `recipient_known_people_test.dart` (empty query lists
people from open channels and DMs, excludes archived and non-member
channels, loads a missing name; agents stay ahead of people and people
don't wait for an unloaded agent list; the real user cache reads each
unnamed person once across rebuilds; Add members skips the channel's own
members; at most 50 people are gathered; typed query adds nothing) and
`recipient_late_agents_test.dart` (Add members sheet with a controllable
own-agent list and 60 known people: agents arriving on first load, in a
picker opened mid-reload, and on a reconnect that adds a new agent all
take rows ahead of the people; reload, land, reload, land moves nothing;
typed rows keep their places; 55 agents fill the list and stay put
across reloads and a rename that changes their order; both agent lists
reloading after a reconnect and landing in either order, with a new
agent in the first, keep every earlier agent's row). Confirmed the
late-agent tests fail without the restart. Confirmed the ordering and
read-once tests fail without their fixes. Confirmed the first test fails
without the fix.
- Focused existing validation: `flutter test test/features/channels`
(2,308 passed), `flutter analyze` on the changed directory.
- Automated app run (on an earlier head; iOS 27 simulator, iPhone 17
Pro, a Builderlab test account): opened a private channel, Channel
details, Add members. Before: only the account's own agents. After:
agents, then people from its channels and DMs with names and avatars;
typing `ar` still narrows to directory matches. Captures show real
community members, so they were shared internally rather than embedded
here. Native iOS sheet only; Android and New DM share the provider but
were not run in the app.

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

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Summary

The opt-in iOS zoom gallery rejected PNG and HEIC/HEIF photos, so photo
stacks containing those files opened the Flutter fallback. Accept these
formats by MIME type or file extension, including uppercase extensions
and URLs with query strings.

Preserve animated PNG playback by forwarding continuing decoded frames
to the selected native page. Keep the existing five-photo load window,
coalesce frames while the bridge is busy, skip offscreen frame encoding,
and release listeners on eviction or dismissal. Native updates reject
stale sessions, offscreen pages, malformed frames, and closed viewers.

`BUZZ_NATIVE_PHOTO_ZOOM` remains opt-in. iOS below 18 and unsupported
formats retain the existing gallery.

### Related issue

Follow-up to block#9259. No matching open issue or PR found; block#7666 concerns
desktop HEIC upload tiling, a separate path.

### Testing

- `just mobile-install mobile-check mobile-test` passed.
- Full mobile suite with `BUZZ_NATIVE_PHOTO_ZOOM=true`: 4,623 passed, 68
skipped. Standard configuration: 4,599 passed, 92 skipped; push
configuration and secp256k1 package tests also passed.
- Real PNG and HEIC decoding through the production presentation bridge;
real two-frame APNG decoding with continuing-frame and listener-cleanup
assertions.
- `scripts/test-mobile-photo-zoom.sh` on an iOS 27 simulator exercises
the production native controller, including frame updates, stale-page
rejection, malformed input and teardown.

No physical-device or end-to-end zoom recording captured. This extends
accepted image formats and playback without changing the gallery layout.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
## Summary

Videos previously rendered outside photo stacks and opened only the
Flutter video viewer. Message bubbles now group trailing videos and
photos in their original order, with poster thumbnails or a visible play
placeholder. On iOS 18+, the native zoom gallery (enabled by default)
opens both standalone videos and mixed stacks with AVKit playback
controls, and closing restores the selected stack item.

Flutter downloads only the selected video using fresh media
authentication, streams it to a bounded temporary file, and
cancels/deletes it when selection changes or the viewer closes. UIKit
releases the old player before that file is removed. Failed downloads
and playback expose Retry. Video URLs never enter the image decoder, and
photo-only actions are hidden on video pages.

The existing Flutter viewers remain the fallback. Native zoom defaults
on; `--dart-define=BUZZ_NATIVE_PHOTO_ZOOM=false` remains an explicit
build-time opt-out. Unsupported platforms/formats, unavailable native
presentation, and bridge failures use the Flutter fallback. Native video
pages use Close or accessibility escape to return with zoom; the
photo-specific downward drag recognizer is disabled there to avoid
competing with AVKit controls.

### Related issue

Stacked on block#9314 (PNG/HEIC photo formats); merge that first. No matching
open video-stack/zoom PR found.

### Testing

- Default-on follow-up: presentation tests also cover unavailable, null,
and throwing bridge responses.

- `just mobile-check mobile-test`: analysis clean, 4,601 mobile tests
passed, plus push-configuration and secp256k1 package tests.
- Full native-enabled mobile suite: 4,626 passed, 68 skipped; rerun
passed at `dc752dccaa664cb56a19cbe517a266d1407a1100`.
- Mixed-stack widget journey covers order, video opening, returning to
selection, and the photo-only fallback gallery.
- Native bridge tests cover video snapshot presentation, selected-only
dispatch, stale sessions and keeping video URLs out of image decoding.
- Real HTTP download journey covers authenticated requests, Retry, byte
limits, cancellation and temporary-file cleanup.
- Native simulator fixture decodes a real MP4 and verifies selected-only
loading, player release on paging and teardown. Removing playback
cleanup makes the regression fail; restoring it passes.
- No physical-device installation or end-to-end zoom recording captured.

### Widget previews

Actual Flutter renders with sample video URLs and no poster metadata;
these show the stack layout, not device playback.

| Received, light | Sent, dark |
| --- | --- |
| ![Received video stack without poster
images](https://github.com/user-attachments/assets/af6d06a7-10e3-43c4-87de-52324be5b19c)
| ![Sent video stack without poster
images](https://github.com/user-attachments/assets/5b79b5b1-e3d4-4482-bbf6-574849d5dfdc)
|

### Human verification pending

On a normal build on iOS 18+ (no extra flag required), open a message
containing photos and videos, page between them, play a video, and
close. Verify playback controls work, only the selected video plays, and
closing returns to the selected stack item.

---------

Signed-off-by: kenny lopez <klopez4212@gmail.com>
Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz>
…their own members section (block#9320)

## Summary
Mobile kept offering archived people and agents as choices: Add members
(including adding an agent to a Solo chat), New DM, the `@` mention
chooser, Search › People and the Agents page. An archived agent that
shares a live agent's name also forced a qualifier onto the live one,
because names were told apart across both. The members sheet listed
archived members among live ones with nothing to mark them.

Now, matching desktop:
- Archived people and agents are left out of those choices. History
(messages, activity, profiles) still shows them.
- The members sheet moves archived members out of People and Agents into
their own "Archived · N" section after both: archived people, then
archived agents. Each row reads "Archived · Member" (or Agent) in place
of the role, status or "Working…" line. A screen reader reads it with
the name. The members preview on the channel info page (the first five
members above "See all") follows the same order and label.
- Nothing is hidden or marked while the community's archive list is
unknown or cannot be read, and you are never hidden from yourself.

### Related issue
None found. The desktop members dialog gets the same Archived section in
block/buzz-app#3203.

### Testing
Widget and provider tests cover each surface, the unknown-archive case,
the viewer rule and a community switch. Each test fails without its
change.

Android emulator, local relay, fictional names. Each archived person or
agent has a live namesake. History rows still show archived identities,
as intended.

**`@` mention chooser, typing "@sc" (Scout `qsfn` is archived)**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/6693729c-66c1-4433-8a7b-4f0e948057ee"
width="320"> | <img
src="https://github.com/user-attachments/assets/eb4f80be-780e-4dbe-8b2b-e6a5b6c3ca97"
width="320"> |

**`@` mention chooser, typing "@ca" (Casey Lee `9mhy` is archived)**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/b6d409cd-7af1-4da7-b5b9-deece5e21de5"
width="320"> | <img
src="https://github.com/user-attachments/assets/60e21387-791b-4233-b8e6-1a29f94e6810"
width="320"> |

**Add members, searching "Morgan" (Morgan Reyes `ssc2` is archived)**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/1222a923-5e43-4263-843d-57564bdc7af3"
width="320"> | <img
src="https://github.com/user-attachments/assets/dbe58278-788d-4a89-83bf-f0b4bc119c5e"
width="320"> |

**Add members, searching "Atlas" (Atlas `85gl` is archived)**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/55c67a21-4cf5-47c5-b6ac-1ba80d68a3ec"
width="320"> | <img
src="https://github.com/user-attachments/assets/54b19ab3-fa2f-4933-8b67-1056d6e3b3a4"
width="320"> |

**New DM, no query yet**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/6a26fd49-4a06-47bd-ba37-37e5898ab344"
width="320"> | <img
src="https://github.com/user-attachments/assets/3f33eb2b-f27a-4528-91c0-ac76d3fdf44b"
width="320"> |

**New DM, searching "Morgan"**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/22d2d617-3074-4910-8c39-e0778e47a879"
width="320"> | <img
src="https://github.com/user-attachments/assets/fa00b160-e350-49af-94d0-beb15c357bef"
width="320"> |

**Search › People, "Morgan"**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/83a28f2b-9b22-4d0c-8728-8a2dfb10e634"
width="320"> | <img
src="https://github.com/user-attachments/assets/573aed3f-75ab-478f-8c11-bedab5c6ce4f"
width="320"> |

**Agents page**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/d7980f95-825c-4d1a-ad67-95f906a52e9a"
width="320"> | <img
src="https://github.com/user-attachments/assets/6252c38a-b2ec-48dc-ab4e-824ea29bbd85"
width="320"> |

**Channel info, members preview**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/8744cdfd-c073-4ade-bd53-9d5e137cee60"
width="320"> | <img
src="https://github.com/user-attachments/assets/5240b1be-13d5-4f22-85a9-8375f1d8ac18"
width="320"> |

**Members sheet, top**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/c9241478-99b1-452e-ad41-8c38fe080182"
width="320"> | <img
src="https://github.com/user-attachments/assets/3c6f9247-60c6-47df-94b0-9175f25805bb"
width="320"> |

**Members sheet, scrolled to the end**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/7da7fcc8-28ea-4c7a-904e-91ca5a068d23"
width="320"> | <img
src="https://github.com/user-attachments/assets/024f676e-8150-457d-b7d0-67fa1a680f8d"
width="320"> |

## Details
- The archive reader (the community's NIP-IA archive list, signed by the
relay's NIP-11 `self` key) moves from `shared/me` to
`shared/identity_archives`, since it is no longer Solo-only.
`hiddenArchivedIdentitiesProvider` is the single rule the surfaces read.
- Pulling to refresh on the Agents page also rereads the archive list.
Other views reuse the last list, as on desktop; it is also reread on
reconnect and when the agent inventory changes.
- A refresh keeps the last known list. After a community or account
switch, the previous community's list does not apply: nobody is hidden
until the new list arrives.
- The shared chooser drops archived identities before names are
compared, which covers Add members, New DM and mentions.
- Search › People asks the relay for 24 people and shows the first 8
that are not archived, so archived matches do not push live people out.
- The channel info preview shows the label on one line, so with a long
name the role after "Archived" can be cut off. A screen reader still
reads it in full.
- Not changed: typing a full `@Name` by hand (without the chooser) still
resolves against archived channel members too, so an archived namesake
can still make a typed name ambiguous. Picking from the chooser is
unaffected. Possible follow-up.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…k#2382)

## Summary

A REQ handler runs as a spawned task and can pause in its access checks.
Before this change it took its subscription ID only when it registered.
So:

- `REQ x`, then `CLOSE x` while the REQ was still in its access checks:
the relay sent `CLOSED x`, and then the REQ registered `x` anyway and
sent events and `EOSE` under an ID the client had closed.
- `REQ x` (A), then a newer `REQ x` (B): if A finished its checks after
B registered, A replaced B, or A's refusal retired B and sent a `CLOSED`
the client could not tell from B failing.

Now the read loop admits each REQ and sync REQ, in arrival order, before
it spawns the handler: the newest request owns the ID from the moment it
arrives. A `CLOSE` or a newer same-ID request fences an older one that
is still pending. A fenced request does not register, and does not send
`NOTICE`, `CLOSED`, `EVENT` or `EOSE` for the ID.

This builds on the owner token and lifecycle lock that block#8522 added. That
PR fenced output after registration; this one moves the token to
admission, so the same fence also covers the time before registration.

The pubsub retain no longer waits on a full subscriber command queue.
Callers hold a connection's lifecycle lock while they retain. A retain
past a full queue now leaves a coalesced wake-up, and the subscriber
subscribes every retained topic it is missing. A retain that fits in the
queue leaves no wake-up, so first retains do not each make the
subscriber rescan the map.

## Behavior

- `close::admit` runs in the read loop before spawn. It records the
request's token in the connection's subscription map, with a flag that
says whether the request has claimed yet. It also applies the
subscription limit, which moves there from the handlers.
- Claims (`claim_admitted_live`, `claim_admitted_search`, the sync
claim) register only while the request still owns its token.
- Refusals after admission go through `close_if_owner`. The two REQ
refusals that also send a `NOTICE` send it in the same critical section.
- Refusals before admission (rate limit, admission quota) still retire
the old holder, as before.
- The old holder stays registered until the newer request claims or is
refused, as before.
- A channel-access eviction that removes an old holder while a newer
same-ID request is still pending retires only the old holder. It sends
no `CLOSED` for the ID, because the client already replaced that holder,
and the newer request still claims.

Client-visible changes to the subscription limit:

- The limit is checked on arrival, before scope, auth and filter checks.
On a full connection, a REQ for a new ID that would also fail those
checks now gets `CLOSED "error: too many subscriptions"` instead of the
other refusal.
- Requests still in their access checks count toward the limit.

## Scope

Live fan-out does not check the token. A same-ID request that has
arrived but not yet claimed does not stop live events to the old holder.
That path is unchanged here.

If a handler panics before it claims, its token stays in the map until a
`CLOSE`, a same-ID REQ, or the disconnect removes it. Until then it
counts toward the subscription limit.

## Testing

- `close_fences_a_req_whose_handler_has_not_run` (REQ and sync REQ):
`REQ x` then `CLOSE x` before the handler runs gives only `CLOSED x` and
no registration.
- `only_the_newest_same_id_req_answers`: of two same-ID REQs, only the
newer one answers.
- `superseded_or_closed_requests_cannot_claim`: an older request cannot
claim after a newer one, and a closed request cannot claim or close.
- `revoke_of_a_replaced_holder_spares_the_pending_replacement`: a revoke
of the old holder sends no `CLOSED`, keeps the pending request's token,
and the pending request then claims its own channel.
- `queue_full_retain_does_not_wait_and_schedules_reconciliation`
(pubsub).
- `live_subscriber_recovers_a_dropped_subscribe_hint` (pubsub, requires
Redis): it runs the real subscriber on a live link and drops a topic's
subscribe hint with a full queue. The topic is still delivered without a
reconnect and without `Confirm`. The same holds after the topic is
released, unsubscribed and retained again.
- Mutations: with no owner check in `close_owned`, both connection tests
fail. With no owner check in `claim_admitted_live`, the claim test
fails. With no `replaced` check in the eviction, the revoke test fails.
With no reconcile arm in the subscriber, or no `notify_one` in
`retain_topic`, the Redis subscriber test fails.
- CI: the four new relay tests and the full-queue pubsub test are added
to `just test-unit` and `scripts/run-tests.sh`. The Redis subscriber
test runs in a new Redis-backed backend-integration step.
- `cargo test -p buzz-relay --lib` (with `--skip config::tests`, which
hangs locally when run in one process), `cargo test -p buzz-pubsub --
--include-ignored` against a local Redis, `cargo clippy -p buzz-relay -p
buzz-pubsub --all-targets -- -D warnings`, `cargo fmt --all -- --check`.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Summary
In Solo, two agents with the same name looked identical: the agent
picker, the new-chat draft ("Message Atlas"), the chat header and its
agent switcher, and the "working" label all showed the raw name. Now
they use the same disambiguated labels as the rest of the app, so
same-name agents read differently everywhere in Solo, and one agent
reads the same in every place.

### Related issue
None found.

### Testing
Widget tests open the picker and header with two same-name agents,
switch between them, and archive one (the remaining agent goes back to
its plain name). Further tests cover a saved agent switch and a resumed
new chat that still point to an archived agent with a live namesake, and
Solo rows with no working agent building no names. A focused test covers
which name Solo shows. Each fails without its change.

Android emulator, local relay, fictional names. Two live agents are both
named Helper; Atlas and Scout each have an archived namesake, which Solo
already left out.

**New Solo chat › Choose an agent: two agents named Helper**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/ff43e3cd-d8f3-4555-bc6b-6109b57993c0"
width="320"> | <img
src="https://github.com/user-attachments/assets/b1a73f63-fe00-49f8-b6ff-0c6a6cfc2d82"
width="320"> |

**New-chat draft with one Helper picked**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/4f375e0c-ce82-4787-b187-137ca25449ce"
width="320"> | <img
src="https://github.com/user-attachments/assets/d8626e98-e1db-437d-9824-cf83af26d752"
width="320"> |

**Chat settings › Agent row of an existing Solo chat**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/e7b0d3a0-10d2-4140-b5c0-b4a3857085ae"
width="320"> | <img
src="https://github.com/user-attachments/assets/e6a736ec-24af-4142-ba3f-1c68f64d80f7"
width="320"> |

**Agent switcher opened from that row**

| Before | After |
| --- | --- |
| <img
src="https://github.com/user-attachments/assets/8eb1a66d-ff6d-4dc2-8df7-6c71732f186d"
width="320"> | <img
src="https://github.com/user-attachments/assets/9669231f-d842-4d32-bb13-ecd6a2b01e8f"
width="320"> |

## Details
- Names are compared only across the agents Solo offers. Archived agents
are already left out of that list, so an archived namesake adds no
qualifier.
- A saved choice can still point to an archived agent: a pending agent
switch (its notice and the Resume/Discard dialog) or a new chat waiting
to be resumed. That agent is labeled against the live agents, so it does
not read exactly like a live namesake.
- A Solo row reads names only while an agent is working in it, and
working rows share one name context.
- The chat header reads Solo names only in Solo chats, so channel and DM
pages no longer rebuild on every profile load (from
block#9324 by Tom Brow).
- Solo keeps showing the owner's own name for an agent (from their agent
list) ahead of the agent's self-published profile name. A verified name
still wins over both.
- An agent with no name now shows the short npub, like every other
picker, instead of a truncated hex key.

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

---------

Signed-off-by: Logan Johnson <loganj@squareup.com>
Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: corey <2dafccf60ea6d431a568f6d67fc600160d92a51e415e09dc8b213b8e360663d5@localhost>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
## Problem
Four request paths converted a client-supplied `usize` filter limit with
an inline `as` cast before clamping: `(l as i64).min(max)` (REQ query
params, bridge feed) and `(l as u32).min(max)` (WS NIP-50 search, bridge
channel window).
- A limit above `i64::MAX` turns negative (`usize::MAX as i64 == -1`).
On REQ and the bridge `/query` general path it reaches Postgres as
`LIMIT -1`, which fails the query. On the bridge feed it trips
`feed_count >= limit`, so the feed comes back empty.
- A limit that is a multiple of 2^32 wraps to `0` through `as u32`. That
returns no rows (one row in the window, via `.max(1)`) instead of the
page max.

Bridge thread and HTTP search already clamped before casting. COUNT
drops the row limit, so it was not affected.

## Change
- Add `buzz_core::filter::clamp_limit(limit, default, max) -> u32`. It
returns `default` when the limit is absent; otherwise it saturates the
request to `u32` and then caps it at `max`.
- Use it at every filter-limit site: `filter_to_query_params` and WS
search in `handlers/req.rs`; channel window, feed, thread and HTTP
search in `api/bridge.rs`. The inline casts are deleted, and
`BRIDGE_FEED_MAX_LIMIT` is now `u32`.
- Each site keeps its default, max and `limit: 0` behaviour. In-range
limits are unchanged.

## Testing
Failing before the fix (`cargo test -p buzz-relay --lib
huge_filter_limit`):
```
assertion `left == right` failed
  left: Some(-1)
 right: Some(1000)
test result: FAILED. 0 passed; 1 failed
```
After:
- `cargo test -p buzz-core --lib clamp_limit` → 1 passed (table test
covering absent, 0, in-range, at/over max, the u32 boundary and
`usize::MAX`)
- `cargo test -p buzz-relay --lib -- huge_filter_limit req:: bridge` →
152 passed, 0 failed (135 Postgres tests ignored)
- `cargo clippy -p buzz-core -p buzz-relay --all-targets -- -D warnings`
→ clean; `cargo fmt --all` → clean
- pre-push hooks (incl. rust-tests) passed

## Not covered
No Postgres-backed tests were run locally. The bridge call sites rely on
the shared helper's table test; they have no per-handler tests.

## Review
Every server-side read of `Filter.limit` now goes through `clamp_limit`.
The per-site default, max and `limit: 0` behaviour is unchanged. No
inline casts are left. Scores: minimalism 9, elegance 9, correctness 9.

Blockers: none.

Fixed in review:
- `PAGE_LIMIT_MAX` had been inserted between `filter_to_query_params`'s
doc comment and the function, so the doc comment ended up on the const.
Moved the const above it.
- Corrected the problem statement. The bridge feed returned an empty
feed rather than a Postgres error, COUNT was never affected, and thread
and HTTP search were already safe.

Optional:
- WS search, bridge window and bridge feed have no per-handler
regression test. Reverting one of them to an inline cast would not fail
any test.
- `bridge.rs` now has two functions called `clamp_limit`: the local
moderation `clamp_limit(Option<i64>)` and
`buzz_core::filter::clamp_limit`. They don't collide, but they are easy
to confuse.

## Exercised on a local relay

**Commit tested:** `88d76f7f1`. Dev profile, isolated harness relay on
:3030, authenticated channel member. Human rate limits were raised so
seeding wasn't throttled. I seeded 1,100 kind-9 events in one channel.
The filters were sent as raw JSON so the large integers arrived exactly.

| Path | `limit` 18446744073709551615 | `limit` 4294967296 | `limit` 50
(control) |
|---|---|---|---|
| WS `REQ` | EOSE after 1000 | EOSE after 1000 | EOSE after 50 |
| WS `REQ` with `search` | EOSE after 1000 | EOSE after 1000 | EOSE
after 50 |
| HTTP `/query` | 200, 1000 events | 200, 1000 | 200, 50 |
| HTTP `/query` with `search` | 200, 500 | 200, 500 | 200, 50 |
| HTTP `/query` `top_level` (channel window) | 200, 201 (200 + bounds
event) | 200, 201 | 200, 51 |
| HTTP `/query` `feed_types` | 200, 100 | 200, 100 | 200, 50 |

Every huge limit came back as that path's maximum. None of them produced
a database error, and none came back empty. The relay log has no error
lines, and the access log records the raw `limit` as
18446744073709551615 with `outcome:"served"`.

**Postgres-gated tests:** the PR adds or modifies none. As a related
check I ran `cargo test -p buzz-relay --lib -- --ignored limit`. Run in
parallel, it gave 10 passed and 1 failed:
`rate_limited_query_logs_one_denied_line`. That test passes on its own,
and the whole set gives 11 passed with `--test-threads=1`. It looks like
interference between tests that share the access-log capture, not a
problem with this change.

**Not exercised:**
- Bridge thread path.
- A before/after comparison against main.

Signed-off-by: David Grochowski <dgrochowski@squareup.com>
**Context:** block#9306 (merged) added link-preview tags to the invite page.
To build the media URLs, the relay looks up the community for the
request host. This fixes a problem found in our review of block#9306.

**Problem:** The invite page waits for that lookup with no time limit.
When the database is slow, the lookup can take as long as the pool
acquire timeout (3 s) plus the statement timeout (120 s by default).
During that time, a person who opens an invite link gets no page. Before
block#9306, this page did not use the database.

**Fix:** The lookup gets 250 ms. If it does not finish, the relay sends
the page without the preview tags. A healthy indexed host lookup
finishes well inside that, so crawlers still get the tags, and nothing
else changes: the media route, the router and the build are untouched.

### Validation

- Added test: a host whose lookup never finishes gets the plain page.
Without the timeout, this test hangs (confirmed locally; it was killed
after 30 s).
- The existing `invite_preview` and router invite tests pass.

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

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@buzz.block.builderlab.xyz>
Neither mobile app offers a way to reach Builderlab's web-only account
features: GitHub linking, billing and creating a community. This adds a
**Builderlab account** row to Settings that opens the build's Builderlab
origin (app.builderlab.xyz on public builds) in the system browser.

The row shows only on public builds. An internal build's Builderlab is
its organization's tenant, where billing and the single community are
managed by the organization, so the link wouldn't lead anywhere useful.
Nostr-only builds have no Builderlab.

Sign-in uses a non-ephemeral `ASWebAuthenticationSession`, which shares
Safari's cookies, so Safari can reuse the Builderlab web session. A
browser other than Safari, or Android, may still ask the user to sign
in.

| Before | After |
| --- | --- |
| <img alt="before"
src="https://github.com/user-attachments/assets/a8f2157b-5a54-41fc-8937-013638b3347e"
width="300"> | <img alt="after"
src="https://github.com/user-attachments/assets/f1161f3b-c926-4a8c-b6a1-7532ef72749c"
width="300"> |

Nothing else gets worse. The change adds one row and one browser launch
on tap, and does no work at startup or in the background. A failure
stays inside this row: if the browser doesn't open, a toast says so.

### Validation

- Added tests: `builderlab_account_row_test.dart` checks that the row
opens `HostedEnvironment.origin` and shows a toast when the browser
fails to open (public build), and that the row is absent otherwise. It
is added to the CI public-build lane.
- `settings_page_test.dart`: the version-footer scroll check now finds
the footer after it scrolls just offscreen. The extra row pushed it
there under public-build defines.
- Settings tests pass under both public and Nostr-only defines, and
`flutter analyze` is clean.
- iOS simulator (public build, signed in to the public Builderlab): the
row appears below Connection, and tapping it opens Safari at Builderlab.
This simulator's session came from an identity import, not the in-app
browser sign-in, so Safari was signed out. I haven't yet verified that
Safari arrives signed in after a real in-app sign-in.

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

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: studio <dc2fc481343672df31a689840c09299972e704dac592e0da6f18486646a7ee3e@localhost>
Adds **Start Solo chat** to the message long-press sheet and the inbox
row menu, analogous to buzz-app desktop's action.

## Behavior

- Opens an unsent New chat draft (no channel is created until the first
send), with the composer expanded and focused.
- **Open channel messages** (public stream or forum) are seeded with the
message's `buzz://` link, as desktop does, so the agent can open it.
- **DMs, private channels, Solo chats and unknown channels** are seeded
with the message excerpted as a Markdown block quote, because the agent
usually can't read them. A long quote is cut at 6 KB so the first
message stays under the 8 KB limit.
- Starting again from the same message returns to the same draft (keyed
`new-solo:<messageId>`).
- Unlike desktop, it's available on your own messages too.
- In the sheet it's a list row under **Copy text**; in the inbox menu
it's under **Open conversation**, for message items with content.
- The draft title skips a leading block quote and uses the prompt after
it (or the quote text when there's no prompt).

## Notes

- A seeded draft left unsent stays in the inbox Drafts list, as an
unsent New chat draft already does.
- Conflicts with block#9142 (inbox row menu follow and remind actions), which
reindents `_showRowActions`. Whichever lands second needs a small
rebase.

## Demo

Public channel message (linked), private channel message (quoted), then
a public channel inbox item (linked) and a DM inbox item (quoted). Test
data only.


https://github.com/user-attachments/assets/91d2de7f-d35d-4907-bcf6-ec904327f06c

## Before / after

| | Before | After |
|---|---|---|
| Message long-press sheet | <img
src="https://github.com/user-attachments/assets/da79ae08-68a0-4396-9a63-f01af9ceb3a3"
width="260"> | <img
src="https://github.com/user-attachments/assets/88ee6ff1-66d6-42fe-8b78-ab7f4e6cbcfa"
width="260"> |
| Inbox row menu | <img
src="https://github.com/user-attachments/assets/5c6f551c-63f5-40ab-b0a3-08778472d964"
width="260"> | <img
src="https://github.com/user-attachments/assets/25f9fa30-ac52-4b78-85fb-5679ca336495"
width="260"> |

Where it lands (new, unsent New chat draft):

| Public message | Private message | Public inbox item | DM inbox item |
|---|---|---|---|
| <img
src="https://github.com/user-attachments/assets/245204d3-0a56-4029-a2a6-e9d054ee6e0e"
width="190"> | <img
src="https://github.com/user-attachments/assets/3d5a100b-5ae5-470e-b945-8c9b24ac1db0"
width="190"> | <img
src="https://github.com/user-attachments/assets/8deea67e-07f4-4fc8-93d8-981fbe848c1d"
width="190"> | <img
src="https://github.com/user-attachments/assets/0f4b62c9-81ba-4d08-a77c-8298f3b46718"
width="190"> |

## Validation

- Automated simulator run (iOS 27 sim, Remote Agents Pilot): sheet on
own message in a public channel seeds the link chip; sheet on a private
channel message seeds a quote; inbox public channel item seeds the link;
inbox DM item seeds a quote. Recorded as the demo above.
- New `solo_chat_seed_test.dart` table test (link, thread link, quote
trimming, multi-line quote) and two new title cases in
`me_chat_creation_test.dart`.
- `flutter test`: all pass except the 4 `right drag starting on/beside a
link replies` cases in `channel_detail_page_test.dart`, which fail
identically on clean `main`.

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

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…lock#9248)

Desktop prefills an empty composer with the agents your latest message
in that conversation notified. This brings the same behavior to mobile
for channels and threads.

### Behavior

- An empty channel or thread composer starts with `@Agent ` for each
agent that the viewer's latest loaded message in that conversation
notified (its `p` tags). It reads what the view displays: the main
timeline in a channel (top-level messages and broadcast replies), and
the head plus its direct replies in a thread. Deleted messages don't
count, and same-second messages follow the display order.
- People are never carried over, and neither are agents that are no
longer channel members (agent here means a member with the bot role or
an owned agent, the same classification the mention picker uses).
- The prefill comes from messages already loaded, with no extra relay
reads, so it follows sends from other devices.
- It isn't a draft: nothing is saved (no Drafts entry) until the viewer
edits it, and it sends no typing indicator.
- Removing it lasts until the composer is shown again (leave and reopen)
or the viewer sends another message there. Sending without the agent
ends the chain.
- An untouched prefill is taken back once it's out of date: when the
viewer's latest message (even one sent from another device) tags no
agent, or its agents have all left the channel. Text the viewer wrote is
never cleared.
- DMs and Solo chats are unchanged. There's no settings toggle.

Also moves the composer's keyboard-metrics observer effect into a
`helpers.dart` hook, unchanged, to keep `compose_bar_widget.dart` under
the 1200-line limit.

### Validation

Added tests: a compose bar widget journey covering prefill from the
latest own message (ignoring people and others' messages), no saved
draft until edited, send then re-prefill, removal sticking through a
member/name refresh and returning on remount, and no prefill for an
agent that left. A second test covers taking back an untouched prefill
after a newer agent-less message or the agent leaving, while keeping
text the viewer wrote. A unit test checks same-second display order.
Breaking the draft skip, the removal guard or the take-back fails them.

Full mobile suite: all pass except 4 `swipe_reply_tests` "right drag …
replies" cases, which fail identically on the base commit (stale after
the swipe-left-to-reply change).

Simulator (iPhone 17 Pro, debug build, test community, run on the first
commit; the take-back follow-up is covered by the widget tests): after
mentioning an agent in a channel, the composer refilled with it; sending
again refilled it; deleting it kept the composer empty until leaving and
reopening the channel, which brought it back; a thread with no
agent-tagged reply had no prefill, and after replying with an agent
mention the thread composer prefilled it. Demo video is shared
internally rather than here, since it shows a real account.

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

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…#9346)

Expanding a Buzz notification today shows the same stub as the banner:
one line of at most 180 characters, with code replaced by `[code]` and
links by `[link]`. A long message can only be read by opening the app.

The notification body is now the message's own text. It keeps line
breaks, the text of code and bare URLs, and drops the Markdown syntax
around them (`[text](url)` shows `text`). It is capped at 256 UTF-16
units, which is the most iOS shows even when a notification is expanded.
iOS cuts longer bodies mid-word with no ellipsis, so the cap stops at
255 units and adds "…" without splitting a character. A link label,
image alt text or bold run may contain code, and a code fence with no
closing fence runs to the end of the message. The body is built from at
most the first 4096 UTF-16 units of the message, so very long or hostile
Markdown stays fast (under 300 ms for a 256 KB message in an optimized
build); when that cut drops text, the body also ends with "…".

| Before (expanded) | After (expanded) |
| --- | --- |
| <img width="300" alt="Before"
src="https://github.com/user-attachments/assets/7201791f-9556-446a-86d2-a50f024cf9dc">
| <img width="300" alt="After"
src="https://github.com/user-attachments/assets/3fa52db8-ebcf-470f-9175-47fe5ef4ed12">
|

[ADR 0002](docs/adr/0002-notification-message-text.md) records the rules
so other mobile platforms follow them, and the cases in
`test-fixtures/notification-body.json` are the contract. The iOS tests
run every case, and Android's notification code can run the same file
when it lands.

**What gets better, what doesn't get worse:** only the body text of
message notifications changes. The title, subtitle, grouping, avatars,
navigation and dedupe are untouched, and the change lives in one pure
function. A notification can now show code and URLs from the message, as
the message itself does, and the user's lock-screen preview setting
still applies.

### Validation

- Added tests: `testPreviewBodyMatchesSharedNotificationBodyCases` runs
the 30 shared cases (links, mentions, images, fenced and inline code,
code inside link labels and bold runs, Markdown inside code, unclosed
and cut fences, whitespace, the cap at 256 and 257 units, emoji and ZWJ
sequences at the cap, the 4096-unit input cut). The full BuzzPushKit
suite passes: 112 XCTest and 70 Swift Testing tests.
- iOS limit measured on an iPhone 17 Pro simulator (iOS 27) with a local
notification: the expanded body and its accessibility label both stopped
at exactly 256 UTF-16 units (256 ASCII characters, 128 emoji), cut
mid-word with no ellipsis. A 40-line body showed about 31 lines.
- The screenshots show this function's before and after output for the
same message, posted as a local notification. The simulator doesn't run
the Notification Service Extension for `simctl push`, so the full push
path (relay fetch through to display) was not exercised. An iPad was not
measured.
- Human testing is waived; the automated run above covered display of
the changed body only, since nothing else in the app changes.

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

---------

Signed-off-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Tom Brow <tomb@squareup.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Brings block/buzz main from 44b3c48 (09.11.) to 95dd9d6 (11.11.),
14 commits, no migrations. Backend changes: fence pending subscriptions
on close or replacement (block#2382), saturate filter limits instead of
casting (block#9230), bound the invite preview host lookup (block#9308). The rest
is mobile.

Merged without conflicts. The fork's transient-fault reconnect guard in
handlers/auth.rs and Cargo.toml/Cargo.lock are unchanged.

Signed-off-by: Christian Schröder <christian.w.schroeder@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cwschroeder

Copy link
Copy Markdown
Owner Author

Testspuren für 46c4b8724 auf Studio 2, mit dem festgelegten Rust 1.98.1 (Hermit), gegen Postgres 17 und Redis 7 als Wegwerf-Container:

  • Unit-Tests cargo nextest run -p buzz-relay -p buzz-pubsub -p buzz-core: 2.142 von 2.142 bestanden.
  • cargo clippy --locked -p buzz-relay -p buzz-pubsub -p buzz-core --all-targets -- -D warnings: ohne Befund.
  • Postgres-Spur scripts/postgres-test-run.sh -p buzz-relay -p buzz-pubsub --lib --tests: 641 von 641 bestanden.

Die übrigen Spuren laufen in der Fork-CI.

Der Stand vor diesem PR, 04498c170 (PR 8), ist seit 16:45 live: Schema 86, gleiche Anzahl Events, Kanäle und Mitglieder, 5 von 5 Anmeldungen nach dem Neustart erfolgreich, Media lesen und schreiben geprüft.

🤖 Generated with Claude Code

@cwschroeder
cwschroeder merged commit ae7f9c0 into customizing/cschroeder Nov 11, 2026
74 of 99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants