Skip to content

fix: same-timestamp events dropped, silent timestamp fallback, stale docs ref, Cargo cruft #35

Description

@Donemmanuelo

AuditBridge version or image digest

main @ 704a08b (unreleased, Cargo.toml 0.1.0)

Steps to reproduce

  1. Two audit events share the same RFC3339 timestamp (NetBird returns them in
    one poll; both are delivered and the per-sink cursor advances to that
    timestamp). A third event with the same timestamp arrives in a later poll.
    process_cycle filters with strict ts > cursor, so the third event is
    dropped permanently — silent event loss.
  2. An event with an unparseable timestamp hits the Loki encoding:
    timestamp_to_nanoseconds silently substitutes Utc::now(), rewriting the
    audit time to "right now", non-deterministically across polls.
  3. src/netbird.rs comments reference the README's "Scaling Limits" section,
    which does not exist.
  4. Cargo.toml carries commented-out dependencies (tokio-rusqlite,
    rusqlite, dotenvy).

Expected behavior

Events at the watermark boundary are delivered at least once (boundary event
IDs tracked per sink alongside the timestamp). Unparseable timestamps produce a
deterministic fallback and a logged warning instead of silently rewriting to
now(). Code comments match the README; Cargo.toml is clean.

Actual behavior and sanitized logs

  1. pending.retain(|e| ts > last_ts) excludes same-timestamp events forever.
  2. unwrap_or_else(|_| Utc::now()...) substitutes the current time silently.
  3. Stale reference to a section that was never written.
  4. Dead commented-out dependency lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions