Skip to content

fix(desktop,relay): restore multi-channel workflows list - #4446

Open
Trevongit wants to merge 1 commit into
block:mainfrom
Trevongit:fix/desktop-workflows-list-multi-h
Open

fix(desktop,relay): restore multi-channel workflows list#4446
Trevongit wants to merge 1 commit into
block:mainfrom
Trevongit:fix/desktop-workflows-list-multi-h

Conversation

@Trevongit

Copy link
Copy Markdown

Summary

Desktop Workflows showed No workflows yet after successful saves even when CLI buzz workflows list --channel <uuid> returned rows.

Root cause: get_channels_workflows packed all member channel IDs into one multi-value #h filter. Relay extract_channel_id_from_filter collapsed multi-#h to the lexicographically first channel UUID and pushed that as SQL channel_id, so the query often returned only an empty channel (e.g. #general).

Fix (defense in depth):

  1. Desktop — one single-value #h filter per channel in a single POST /query (NIP-01 OR; each filter is SQL-pushable).
  2. Relay — multi-value #h returns None from the singular extractor (same as bridge/count siblings), so multi-#h widens correctly instead of pinning one channel.
  3. UX — avoid flashing the empty state while channel membership is still loading.

Live Groundfeed repro before this change:

  • #h: [welcome] → workflows present
  • #h: [welcome, skills, general]0
  • two single-#h filters OR → full set

Related work on block/buzz

Others hit the same bug; these open PRs address the relay half (not merged as of this PR):

This PR is complementary: it keeps the Desktop list correct even against unfixed relays, and still hardens the relay path.

Test plan

  • cargo test -p buzz-relay multi_h_filter_does_not_collapse / single_h_filter_extracts pass
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml workflows (11 unit tests) pass
  • Rebuild Desktop from this branch; open Workflows → list should show workflows across member channels (not empty when CLI list is non-empty)
  • Optional: against Groundfeed, confirm multi-channel overview after Desktop rebuild

@Trevongit
Trevongit requested a review from a team as a code owner August 3, 2026 01:04
Desktop Workflows showed "No workflows yet" after successful saves because
get_channels_workflows packed all member channel ids into one multi-value #h
filter. The relay SQL path collapsed multi-#h to a single channel_id, so the
query often returned only an empty channel while per-channel CLI list still
worked.

Issue one single-#h filter per channel in one POST /query (NIP-01 OR), stop
collapsing multi-#h in extract_channel_id_from_filter, and avoid flashing the
empty state while membership is still loading.

Signed-off-by: Trevor P <trev2005@gmail.com>
@Trevongit
Trevongit force-pushed the fix/desktop-workflows-list-multi-h branch from 4f90df7 to 57b2076 Compare August 3, 2026 03:06
@Chkhikvadze

Copy link
Copy Markdown

Independent production reproduction and validation:

  • The deployed relay currently returns an empty result for the Desktop's one-filter/multi-value #h request, while one single-value #h filter per channel in the same request returns all six owner-visible workflow definitions. This confirms the compatibility failure and the fix shape in this PR.
  • I rebased this patch locally onto current main and ran the affected package suites/checks.
  • just desktop-tauri-test: 2,106 passed, 0 failed, 14 ignored.
  • just desktop-test: 3,928 passed, 0 failed.
  • just desktop-check, just desktop-build, just desktop-tauri-fmt-check, cargo fmt --all -- --check, just desktop-tauri-clippy, and cargo clippy -p buzz-relay --all-targets -- -D warnings: passed.
  • cargo test -p buzz-relay: both new workflow regression tests passed; aggregate was 839 passed, 1 failed, 37 ignored. The sole failure was the unchanged api::mesh_demo::tests::demo_join_forwarded_arm_round_trips_echo test (504 vs expected 200), outside this PR's changed files.

GitHub currently reports the PR mergeable; required review is the remaining repository gate.

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.

2 participants