Desktop v0.5.2 shows relay owner as non-member despite active channel_members row
Summary
Buzz Desktop v0.5.2 connects successfully to a self-hosted closed relay, but after relaunch it displays the relay owner as a non-member of channels that the owner created.
The channel is discoverable through search and its messages persist, but Desktop shows zero people and “Join to participate.” Clicking Join has no visible effect.
The relay logs show that it receives the join request and skips it because the identity is already a member.
Environment
- Buzz Desktop: v0.5.2, Apple silicon DMG
- Desktop commit associated with release:
3e48f1b - Client machine: Apple M5 Pro MacBook Pro, macOS 26.5.2
- Relay image:
ghcr.io/block/buzz:main - Relay platform: Apple M4 Mac mini, macOS 26.6, Docker Desktop
- Deployment: official
deploy/composeproduction bundle - Network: private Tailscale address using
ws:// - Relay settings:
BUZZ_REQUIRE_AUTH_TOKEN=trueBUZZ_REQUIRE_RELAY_MEMBERSHIP=trueBUZZ_ALLOW_NIP_OA_AUTH=trueBUZZ_AUTO_MIGRATE=true
Steps to reproduce
- Deploy the official production Compose stack using
ghcr.io/block/buzz:main. - Generate the owner identity using
buzz-admin generate-key. - Configure that public key as
RELAY_OWNER_PUBKEY. - Import the corresponding private key into Desktop v0.5.2.
- Join the self-hosted relay through the “Join a community” onboarding path.
- Complete onboarding and create/use the starter
#generalchannel. - Send a message successfully.
- Quit and reopen Desktop.
- Search for
#generalbecause it is no longer present in the channel sidebar. - Open the channel and click “Join to participate.”
Actual result
- The channel and its messages remain stored and searchable.
- Desktop displays zero people.
- Desktop displays “Join to participate.”
- Clicking Join does not update the UI or restore the channel to the sidebar.
- Each click reaches the relay, which logs:
kind:9021 join — already a member, skipping
Backend verification
buzz-admin list-members confirms the identity is the relay owner.
A direct read-only query of channel_members shows active owner rows for all three starter channels:
role = ownerremoved_at IS NULLhidden_at IS NULL
buzz-admin reconcile-channels reports:
Reconciled 0 channels (3 already had events, 3 total).
The Welcome channel also contains the three starter bots as active members.
Therefore, relay admission, channel membership, discovery events, message persistence, and database state appear correct. Desktop’s membership state disagrees with the authoritative backend.
Version-alignment test
I attempted to use the server image matching Desktop v0.5.2:
ghcr.io/block/buzz:sha-3e48f1b
The image exists, but it cannot start against this database because main already applied migration 26:
migration 26 was previously applied but is missing in the resolved migrations
The relay was returned to ghcr.io/block/buzz:main and is healthy. No migration records or database rows were edited.
Expected result
Desktop should recognize the existing active owner membership, display the member count, allow participation, and retain joined channels in the sidebar after relaunch.
If a redundant kind-9021 join is sent, the relay’s “already a member” success/no-op response should reconcile Desktop to the joined state rather than leaving it as a non-member.
Related issues
- #2815 —
buzz-admin generate-keyemits hex while Desktop requiresnsec1 - #2816 — self-host onboarding path is hidden behind “Join a community”
I traced this end-to-end and shipped a candidate repair as PR #4277: https://github.com/block/buzz/pull/4277
What I think is happening
Your DB is healthy — channel_members rows are correct (role=owner, removed_at IS NULL, hidden_at IS NULL). buzz-admin reconcile-channels confirms kind:39000 discovery events exist. But after Desktop restarts, the sidebar's isMember flag is computed entirely from relay-side kind:39002 events tagged #p=[your_pubkey] (desktop/src-tauri/src/commands/channels.rs:88 — Step 1 of get_channels).
If that kind:39002 snapshot is missing or stale for your pubkey (e.g. an early emission raced and failed silently, or the addressable replace got overwritten by someone else's membership change before your p-tag landed), Desktop cannot distinguish you from a non-member: 0 people, "Join to participate", channel not in the sidebar.
Then comes the second-order bug: when you click Join, the relay hits handle_join_request (crates/buzz-relay/src/handlers/side_effects.rs:1954):
if state.is_member_cached(...).await? {
info!("kind:9021 join — already a member, skipping");
return Ok(()); // ← no repair signal sent back
}
The relay correctly notes you're already a member and returns success without doing anything — so the missing/stale kind:39002 still isn't emitted, and Desktop keeps showing you as a non-member. No matter how many times you click Join, the system can't converge.
The fix in #4277
Keep the membership fast-path (no duplicate notifications, no redundant add_member), but refresh emit_group_discovery_events inside that skip branch. The write is idempotent via replace_addressable_event — no-op for healthy relays, self-healing for broken ones. Desktop's re-fetch after join_channel succeeds then picks up the fresh snapshot and materialises isMember=true.
This matches your stated expectation:
If a redundant kind-9021 join is sent, the relay's "already a member" success/no-op response should reconcile Desktop to the joined state rather than leaving it as a non-member.
Open question for confirmation
To confirm this is the actual bug (vs. an auth/community-binding mismatch at ingest), could you run one of the following against your relay?
# If you have nostcat or similar:
nostcat --req '{"kinds":[39002],"#p":["<your_pubkey_hex>"]}' ws://<your_relay>/
# Or via the DB directly:
docker compose exec postgres psql -U buzz -c \
"SELECT id, pubkey, kind, tags FROM events WHERE kind=39002 AND deleted_at IS NULL;"
If a kind:39002 row exists with a p tag for your pubkey, the bug is client-side auth/session, not what I patched. If it's missing or doesn't include you, #4277 is the repair.
Refs #2815, #2816 (separate, will keep triaging)
Thank you for investigating this and for preparing PR #4277.
I can confirm that upgrading Buzz Desktop from v0.5.2 to v0.5.3 did not resolve the issue. After restarting Desktop, the channel disappears from the sidebar. Search can locate it, but it displays “Join to participate.” Clicking Join reaches the relay, which reports that the identity is already a member, but Desktop does not reconcile its state.
I ran the requested database check. The authoritative channel_members table contains active owner membership for all three starter channels:
- Owner pubkey:
0210c00eb2fec3034REDACTED role = ownerremoved_at IS NULLhidden_at IS NULL
However, the stored kind:39002 events do not contain a p tag for that owner pubkey.
For example, the snapshots for channels:
c781df0d-2144-REDACTEDREDACTED-568a-a58a-d0a22dfa42be7bd79db4-1f87-4b22-bc1d-REDACTED
either contain only the d channel tag or contain p tags for the starter bots. None contain the owner’s public key.
buzz-admin reconcile-channels also reports:
Reconciled 0 channels (3 already had events, 3 total).
This appears to confirm the missing/stale kind:39002 discovery-snapshot case described in your analysis. The authoritative membership table is correct, but the relay discovery events omit the owner, leaving Desktop unable to materialize isMember=true.
The relay remains healthy on ghcr.io/block/buzz:main; no database rows or migration records have been modified.
Resolved in my self-hosted environment: relay identity was reused as the human owner identity
This was resolved through a persistent human-in-the-loop troubleshooting effort. I kept testing the system, preserving evidence, questioning unsuccessful approaches, and pushing the investigation forward after Desktop updates and initial relay checks failed to resolve it. OpenAI Codex helped correlate the Desktop symptoms, relay logs, PostgreSQL state, and NIP-29 discovery records; search for related reports; and guide the backup, key separation, discovery-state rebuild, and verification process. The decisive missing explanation came from @jamiedewar’s excellent report in #4796, which identified the relay/human identity collision and documented a successful resolution.
BUZZ_RELAY_PRIVATE_KEY had been configured using the same identity as the human/community owner identified by RELAY_OWNER_PUBKEY. The authoritative channel_members rows were correct, but the relay-signed kind 39001 and 39002 discovery events silently omitted that identity.
This produced the complete failure pattern originally reported here:
- Desktop displayed the owner as a non-member.
- Channels disappeared from the sidebar after restarting Desktop.
- Search could still locate the channels and their message history.
- The UI displayed Join to participate.
- Clicking Join reached the relay, but the relay logged
already a member, skipping. - Repeated joins could not repair the client state.
buzz-admin reconcile-channelsinitially reported that the existing channels already had discovery events, even though those events omitted the owner.
Confirmed state before repair
There were five active records for each discovery kind:
39000: 539001: 539002: 5
All were signed by the original relay identity. None of the five kind 39002 member lists contained the human owner. None of the kind 39001 administrator lists contained the owner either.
Repair performed
After backing up .env and taking a PostgreSQL dump, we:
- Generated a new dedicated relay keypair.
- Confirmed its public key was different from
RELAY_OWNER_PUBKEY. - Replaced only
BUZZ_RELAY_PRIVATE_KEYwith the new relay private key. - Left the human owner identity and
RELAY_OWNER_PUBKEYunchanged. - Restarted the relay and confirmed it was healthy.
- Soft-deleted only the existing derived discovery events for kinds
39000,39001, and39002. - Ran
buzz-admin reconcile-channels.
The reconcile completed successfully:
Reconciled 5 channels (0 already had events, 5 total).
Verified state after repair
The regenerated records showed:
- All five kind
39000events signed by the new relay identity. - All five kind
39001administrator lists containing the human owner. - All five kind
39002membership lists containing the human owner.
After completely quitting and reopening Buzz Desktop:
- All five channels remained in the sidebar.
- Join to participate was gone.
- The owner appeared correctly as
owner. - The member count was correct.
- The message composer was available.
- A new test message persisted through another full Desktop restart.
Thank you, @jamiedewar, for documenting the identity-collision condition in #4796. That report supplied the missing explanation and a working resolution for this installation.
Thank you as well to @iroiro147 for the investigation and #4277. The redundant-join repair remains valuable: even with the configuration corrected, an already-member join should ideally refresh stale discovery state instead of silently returning without giving the client a way to converge.
Based on this result, I agree with the recommendations in #4796:
BUZZ_RELAY_PRIVATE_KEYshould use a dedicated service identity and never a human/community identity.- The relay should warn or fail at startup when the relay signing public key equals
RELAY_OWNER_PUBKEY. - This requirement should be documented in the Compose deployment instructions.
- The discovery reconciliation path should detect incomplete or stale
39001/39002state, not merely the presence of39000.
The immediate incident reported in this issue is resolved in my environment. I will leave closure/disposition to the maintainers because the underlying validation, documentation, and self-healing improvements remain open.
Adding a fresh, independently-reproduced data point for this bug class (Desktop membership state diverging from relay truth) — different trigger path than the original report, same symptom.
Scenario: Agent-managed channel creation, not the join-onboarding flow.
- Agent (running via Buzz ACP, not Desktop) created a new private channel with
buzz channels create. - Agent added the human owner as a member/owner of that channel via the relay-side membership call.
- Verified directly against the relay:
buzz channels members --channel 05e29b47-46f2-4a79-817c-0ff47a267e7creturns both the agent and the human pubkey with"role":"owner".buzz channels getconfirms the channel exists with correct metadata.
- Human user checked Buzz Desktop repeatedly over roughly 10+ minutes (initial check, several follow-up checks) — the channel never appeared in the sidebar or channel list.
- User performed a full quit-and-reopen (not just a refresh) before each check, so the fix is not "always requires a full relaunch" — but if so, that itself seems like a gap: newly-granted membership should be picked up on a normal poll/refresh cycle, not require killing the app.
Relay-side state (authoritative):
[{"pubkey":"<agent-pubkey>","role":"owner"},{"pubkey":"<human-pubkey>","role":"owner"}]
This lines up with the "Backend verification" section of the original report — membership rows are correct, discovery/channel-get calls are correct, but Desktop's client-side channel list doesn't reflect newly-granted membership without (at minimum) a hard relaunch, and possibly not even then.
Happy to provide the full relay CLI output or channel IDs if useful for repro.