Skip to content

projects update fails on any project older than 15 minutes (CLI head+1 timestamp vs relay drift window) #5665

Closed

Description

@Illuminfti

Summary

buzz projects update (and any other project replacement) computes the replacement event's created_at as head.created_at + 1 (next_timestamp in crates/buzz-cli/src/commands/projects.rs). The relay's ingest path rejects any event whose timestamp is more than ±900s from server time (MAX_TIMESTAMP_DRIFT_SECS, crates/buzz-relay/src/handlers/ingest.rs).

Consequence: updating any project whose head is older than 15 minutes always fails.

Repro (self-hosted relay, CLI built from current main)

$ buzz projects create pr-ts-smoke --repo buzz --name "pr-ts-smoke"
{"accepted":true,...}

# ~2 hours later (or backdate the head to simulate):
$ buzz projects update pr-ts-smoke --description "update on aged head"
{"error":"relay_error","message":"relay error 400: invalid: event timestamp too far from server time","retryable":false}

Even inside the 15-minute window the behavior is off: the replacement is accepted but recorded at head+1, i.e. in the past —

$ buzz projects update pr-ts-smoke --description "update on 52s-old head"
{"accepted":true,...}
$ buzz projects get pr-ts-smoke | jq .created_at
# => 52s older than the wall-clock time of the write

so a concurrent writer using wall clock silently wins LWW against a head+1 writer, and audit timestamps misrepresent when the write happened.

Suggested fix

next_timestamp should return max(now, head.created_at + 1) — strictly after the observed head, but never behind the wall clock. The relay itself already uses exactly this pattern when it authors replacements (now.max(head+1) in crates/buzz-relay/src/handlers/side_effects.rs).

Related: #2876 reports the same head+1-vs-drift-window collision for repos protect set/remove on repos announced more than 15 minutes ago.

PR incoming.

Activity

  1. added a commit that references this issue on Aug 17, 2026
    a282e06
  2. added a commit that references this issue on Aug 18, 2026
    1511b37
  3. added a commit that references this issue on Aug 23, 2026
    de6fc8a
  4. added a commit that references this issue on Oct 7, 2026
    2f5a491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo