Skip to content

refactor(relay): remove unused broadcast stub module (#1313) - #1390

Merged
chappie-daemon merged 2 commits into
rewrite/mainfrom
fix/1313-remove-broadcast-stub
Dec 4, 2026
Merged

chappie-daemon merged 2 commits into
rewrite/mainfrom
fix/1313-remove-broadcast-stub

Conversation

@avantikonde

Copy link
Copy Markdown
Collaborator

Description

Removes the unused crates/nostream-relay/src/broadcast.rs module and pub mod broadcast; from crates/nostream-relay/src/lib.rs, updates lib.rs and docs/rewrite/crate-map.md citations to reflect that cross-worker Redis broadcast is not compiled in and in-process fan-out uses Relay::hub, and adds the required changeset.

Related Issue

Closes #1313

Motivation and Context

crates/nostream-relay/src/broadcast.rs exposed BroadcastMessage, publish, and deduplicate, both of which unconditionally returned RelayError::NotImplemented and had no callers anywhere in the workspace. In-process event fan-out already runs over Relay's own tokio::sync::broadcast channel (Relay::hub). Removing the dead stub eliminates an unimplemented public API without affecting any callers.

How Has This Been Tested?

  • Verified workspace compilation and lints after rebasing onto origin/rewrite/main:
    • cargo fmt --all --check
    • cargo clippy -p nostream-relay --all-targets --all-features -- -D warnings
    • cargo clippy --workspace --lib --bins --all-features -- -D warnings -D clippy::unwrap_used -D clippy::expect_used -D clippy::todo -D clippy::unimplemented -D clippy::panic
    • cargo check --workspace --all-features
  • Verified docs/rewrite/crate-map.md line citations resolve with 0 errors.
  • Ran non-socket nostream-relay test targets (199 passed, 0 failed):
    • cargo test -p nostream-relay --lib --test config_defaults --test hidden_content --test limits --test nip11 --test strategies --test ts_case_parity

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dbe6a0ae-c07b-4f38-904b-0d6a63be5186

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@changeset-bot

changeset-bot Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f23a425

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@greptile-apps

greptile-apps Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Low impact] The PR appears safe to merge.

Summary

Removes the unused broadcast.rs stub and its public module declaration.

  • The relay crate no longer exposes its unused broadcast stub.

Reviews (2) · Last reviewed commit: "docs: update shifted relay lib.rs citati..." · Reviewed by Greptile

Comment thread crates/nostream-relay/src/lib.rs Resolved
@chappie-daemon

Copy link
Copy Markdown
Collaborator

Verified the deletion at 6970010c: no BroadcastMessage or broadcast:: reference survives (the remaining hits are all tokio::sync::broadcast), Relay::hub exists at crates/nostream-relay/src/relay.rs:210, the four crate-map broadcast rows are correct at lib.rs:32-35, and the changeset matches the repo's empty-frontmatter form.

Greptile's P2 is right, and the fix is mechanical: removing four lines above line 45 shifts every citation that lands past line 11. Evidence — git show 6970010c:crates/nostream-relay/src/lib.rs | sed -n '19p' prints a bare //!, which is what crate-map.md:313 and :319 point at today.

In docs/rewrite/crate-map.md:

citation now should be
@types/message-handlers, @types/subscription (lines 101, 111) lib.rs:16 lib.rs:14
admission controller (174) lib.rs:12 lib.rs:11
limiter/cap factory (195) lib.rs:12-13 lib.rs:11-12
four factories (212, 216, 226, 230) lib.rs:17 lib.rs:15-16
routes/admissions (288) lib.rs:13 lib.rs:12
metrics pair (313, 319) lib.rs:19 lib.rs:17
rate limiters, hidden-content cache (327, 330, 380) lib.rs:14 lib.rs:13

lib.rs:8 and lib.rs:9 are unchanged, and the broadcast rows you already updated are correct.

In docs/rewrite/deploying.md:444 the NIP-11 builder moves with the same shift: lib.rs:41-43 → lib.rs:37-39.

With that, this is a clean removal and I'll approve.

@chappie-daemon chappie-daemon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-checked at f23a425: every lib.rs citation in crate-map.md now resolves to the text it names (8, 9, 10, 11, 11-12, 12, 13, 14, 15, 16, 17, 32-35), and deploying.md:444 points at 37-39. The deletion itself is unchanged: no BroadcastMessage or broadcast:: reference survives, Relay::hub is real at relay.rs:210, and the changeset has the form the repo uses. Merging.

@chappie-daemon
chappie-daemon merged commit efd4de6 into rewrite/main Dec 4, 2026
18 checks passed
@chappie-daemon
chappie-daemon deleted the fix/1313-remove-broadcast-stub branch December 4, 2026 19:11
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