diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-10 21:24:21 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-12-10 21:24:21 +0000 |
| commit | 466a009d8248aab274a9da419e4c0d83a4b9f466 (patch) | |
| tree | 19d69825c5013e8ba39721b5ccaf9a84665ce570 /tests/sync | |
| parent | b6c908599c1e63852b8d3b4b20caae344e37a34a (diff) | |
feat(sync): broadcast synced events to WebSocket subscribers
Enable recursive relay discovery by broadcasting synced events to
WebSocket subscribers via LocalRelay.notify_event(). This allows the
SelfSubscriber to receive 30617 announcements synced from external
relays and discover additional relay URLs to connect to.
Changes:
- Pass LocalRelay to SyncManager::new() from main.rs
- Add local_relay field to SyncManager struct
- Call notify_event() after saving synced events to database
- Enable test_recursive_relay_discovery_syncs_announcement test
The test verifies that when relay_a syncs announcement_x from bootstrap
relay_b (which lists relay_c), relay_a discovers and connects to
relay_c to sync announcement_y.
Fixes recursive relay discovery from bootstrap sync.
Diffstat (limited to 'tests/sync')
| -rw-r--r-- | tests/sync/discovery.rs | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/tests/sync/discovery.rs b/tests/sync/discovery.rs index 3cdf00d..9e27f9e 100644 --- a/tests/sync/discovery.rs +++ b/tests/sync/discovery.rs | |||
| @@ -293,12 +293,7 @@ async fn test_layer2_discovery_with_chain() { | |||
| 293 | /// 3. Discovers and connects to relay_c | 293 | /// 3. Discovers and connects to relay_c |
| 294 | /// 4. Syncs announcement_y from relay_c | 294 | /// 4. Syncs announcement_y from relay_c |
| 295 | /// | 295 | /// |
| 296 | /// NOTE: This test is ignored because recursive relay discovery from synced | ||
| 297 | /// announcements is not yet implemented. Currently, discovery only triggers | ||
| 298 | /// when an announcement is directly submitted to a relay, not when it's | ||
| 299 | /// synced from a bootstrap relay. | ||
| 300 | #[tokio::test] | 296 | #[tokio::test] |
| 301 | #[ignore = "Recursive relay discovery from bootstrap sync not yet implemented"] | ||
| 302 | async fn test_recursive_relay_discovery_syncs_announcement() { | 297 | async fn test_recursive_relay_discovery_syncs_announcement() { |
| 303 | // 1. Start all three relays | 298 | // 1. Start all three relays |
| 304 | 299 | ||