Closed ok300 closed 1 year ago
Describe the bug
Starting with commit 2dd972de2f56aee19818f8798869ac9355f6aadd calling Client.get_events_of() returns an empty list.
Client.get_events_of()
This works fine in the commit before that, 2ebd5a117cdb4bd2a16c68da7a61ddef8d82df7d .
Using Client.notifications().recv() works in both commits.
Client.notifications().recv()
To Reproduce
Expected behavior
In the code snippet above, Client.get_events_of() and Client.notifications().recv() should return the same number of events.
Build environment
1.69.0
Additional context
Dependencies in Cargo.toml:
Cargo.toml
[dependencies] nostr = { git = "https://github.com/rust-nostr/nostr", default-features = false, rev = "2dd972de2f56aee19818f8798869ac9355f6aadd" } nostr-sdk = { git = "https://github.com/rust-nostr/nostr", default-features = false, rev = "2dd972de2f56aee19818f8798869ac9355f6aadd" } tokio = { version = "*", default-features = false, features = ["rt", "macros"] }
I reverted that commit at c35a006
c35a006
You're right, didn't see that.
Describe the bug
Starting with commit 2dd972de2f56aee19818f8798869ac9355f6aadd calling
Client.get_events_of()
returns an empty list.This works fine in the commit before that, 2ebd5a117cdb4bd2a16c68da7a61ddef8d82df7d .
Using
Client.notifications().recv()
works in both commits.To Reproduce
Here is a code snippet to reproduce the bug
```rust use std::time::Duration; use nostr::prelude::*; use nostr_sdk::prelude::*; #[tokio::main] async fn main() -> Result<()> { let filters = vec![Filter::new().kind(Kind::TextNote).limit(10)]; let client = Client::new(&Keys::generate()); client.add_relay("wss://relay.damus.io", None).await?; client.connect().await; let res_get_events_of = client .get_events_of(filters.clone(), Some(Duration::from_secs(3))) .await?; println!("recv via get_events_of: {} events", res_get_events_of.len()); let res_notification_recv = get_events_via_notification_recv(&client, filters).await?; println!("recv via notifications: {} events", res_notification_recv.len()); Ok(()) } async fn get_events_via_notification_recv( client: &Client, filters: VecExpected behavior
In the code snippet above,
Client.get_events_of()
andClient.notifications().recv()
should return the same number of events.Build environment
1.69.0
Additional context
Dependencies in
Cargo.toml
: