diff options
Diffstat (limited to 'grasp-audit/src/specs')
| -rw-r--r-- | grasp-audit/src/specs/nip01_smoke.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/grasp-audit/src/specs/nip01_smoke.rs b/grasp-audit/src/specs/nip01_smoke.rs index cd4ae2b..569997b 100644 --- a/grasp-audit/src/specs/nip01_smoke.rs +++ b/grasp-audit/src/specs/nip01_smoke.rs | |||
| @@ -76,6 +76,9 @@ impl Nip01SmokeTests { | |||
| 76 | )); | 76 | )); |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | // Wait a bit for event to be indexed | ||
| 80 | tokio::time::sleep(std::time::Duration::from_millis(100)).await; | ||
| 81 | |||
| 79 | // Try to query it back | 82 | // Try to query it back |
| 80 | let filter = Filter::new() | 83 | let filter = Filter::new() |
| 81 | .kind(Kind::TextNote) | 84 | .kind(Kind::TextNote) |
| @@ -87,7 +90,17 @@ impl Nip01SmokeTests { | |||
| 87 | .map_err(|e| format!("Failed to query event: {}", e))?; | 90 | .map_err(|e| format!("Failed to query event: {}", e))?; |
| 88 | 91 | ||
| 89 | if events.is_empty() { | 92 | if events.is_empty() { |
| 90 | return Err("Event not found after sending".to_string()); | 93 | // Debug: try querying without audit client filtering |
| 94 | eprintln!("Event not found with audit client query, trying direct client query..."); | ||
| 95 | let direct_filter = Filter::new().kind(Kind::TextNote).id(event_id); | ||
| 96 | let direct_events = client.client().fetch_events(direct_filter, std::time::Duration::from_secs(5)).await | ||
| 97 | .map_err(|e| format!("Direct query failed: {}", e))?; | ||
| 98 | let direct_vec: Vec<Event> = direct_events.into_iter().collect(); | ||
| 99 | eprintln!("Direct query found {} events", direct_vec.len()); | ||
| 100 | if !direct_vec.is_empty() { | ||
| 101 | eprintln!("Event tags: {:?}", direct_vec[0].tags); | ||
| 102 | } | ||
| 103 | return Err(format!("Event not found after sending (direct query found {})", direct_vec.len())); | ||
| 91 | } | 104 | } |
| 92 | 105 | ||
| 93 | if events[0].id != event_id { | 106 | if events[0].id != event_id { |