Oak

Check-in [79e5253ad0]
Login

Check-in [79e5253ad0]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:nit(core): Reduce logging for duplicate powpub events
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 79e5253ad025793ac09a701d2707b114715010ebbedc852fb3b0890c6835561a
User & Date: carlos 2023-09-23 12:01:45
Context
2023-09-24
11:05
ref(doc): Update docs check-in: 737fe6affc user: carlos tags: trunk
2023-09-23
12:01
nit(core): Reduce logging for duplicate powpub events check-in: 79e5253ad0 user: carlos tags: trunk
09:45
ref: Bump dependencies check-in: da7d64d77d user: carlos tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/bot/nostr.rs.

295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
    // Only process new (unknown) events
    // This ensures we don't accidentally process the same event twice (e.g. if listening to multiple relays)
    // It also protects against replay attacks from rogue relays
    match db::is_event_known(db, event.id).await.unwrap_or_else(|_| {
        error!("Failed to lookup event ID in DB");
        false
    }) {
        true => warn!(
            "Event {} was already processed, ignoring",
            event.id.to_hex()
        ),
        false => {
            info!("Received new event {}, processing", event.id.to_hex());
            db::mark_event_as_known(db, event.id)
                .await
                .unwrap_or_else(|id| error!("Failed to mark event {id} as known"));

            for ons in available_ons() {







<
|
<
<







295
296
297
298
299
300
301

302


303
304
305
306
307
308
309
    // Only process new (unknown) events
    // This ensures we don't accidentally process the same event twice (e.g. if listening to multiple relays)
    // It also protects against replay attacks from rogue relays
    match db::is_event_known(db, event.id).await.unwrap_or_else(|_| {
        error!("Failed to lookup event ID in DB");
        false
    }) {

        true => debug!("Event {} was already processed, ignoring", event.id),


        false => {
            info!("Received new event {}, processing", event.id.to_hex());
            db::mark_event_as_known(db, event.id)
                .await
                .unwrap_or_else(|id| error!("Failed to mark event {id} as known"));

            for ons in available_ons() {