diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-28 21:00:14 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-28 21:00:14 +0000 |
| commit | f148b3a0e4b032c0acf835cda6d2935e19b9f67e (patch) | |
| tree | dceea944969465ae6855fa8b1c68d3553334fc1f /src/nostr/builder.rs | |
| parent | e9daa340ce1bd215e71d2dc86a81207b7d61df02 (diff) | |
feat(purgatory): track event source for filtered expiry logging
Add EventSource enum (Direct/Sync) to purgatory entries to distinguish
between user-submitted events and sync-fetched events. This enables:
- WARN-level logging for direct submissions that expire (user should know)
- DEBUG-level logging for sync-fetched expirations (expected behavior)
- Source upgrade from Sync→Direct if user submits after sync
- Expiry timer reset on source upgrade (fresh 30-min window for user)
The source is included in [PURGATORY_EXPIRED] logs as source=direct or
source=sync for easy filtering.
Diffstat (limited to 'src/nostr/builder.rs')
| -rw-r--r-- | src/nostr/builder.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nostr/builder.rs b/src/nostr/builder.rs index 629c111..9211972 100644 --- a/src/nostr/builder.rs +++ b/src/nostr/builder.rs | |||
| @@ -399,7 +399,7 @@ impl Nip34WritePolicy { | |||
| 399 | // Add to purgatory | 399 | // Add to purgatory |
| 400 | self.ctx | 400 | self.ctx |
| 401 | .purgatory | 401 | .purgatory |
| 402 | .add_pr(event.clone(), event.id.to_hex(), commit.clone()); | 402 | .add_pr(event.clone(), event.id.to_hex(), commit.clone(), is_synced); |
| 403 | 403 | ||
| 404 | WritePolicyResult::Reject { | 404 | WritePolicyResult::Reject { |
| 405 | status: true, // Client sees OK | 405 | status: true, // Client sees OK |