Files
buzz/crates/buzz-sdk
Wes 051dd2d7aa fix(sdk): timestamp channel messages with millisecond offsets (#9548)
Kind-9 messages sent through the SDK or `buzz messages send` omit the
`ms` tag, so clients break same-second ties by event ID. Capture one
clock reading in the shared message builder and use it for both
`created_at` and the canonical 0–999 millisecond offset, including
direct and nested replies.

Validation: both new regressions failed before the fix; the full CLI
suite (691 tests) and SDK suite (335 tests) pass. The SDK test checks
that the timestamp is pinned before signing; the CLI test captures and
verifies signed HTTP submissions for roots and both reply depths. The
built CLI also sent direct and nested replies through a managed signer
to a live relay; readback confirmed one canonical `ms` tag and correct
thread tags on both. Client ordering and human testing remain pending;
keep this PR draft.

To test manually, run `cargo build -p buzz-cli`, then send several
kind-9 messages with `target/debug/buzz messages send --channel
<channel> --content <text>` and direct/nested replies using `--reply-to
<event-id>`. Inspect their raw events: each should carry exactly one
canonical `ms` value, and a client that honors `ms` should display
same-second sends in timestamp order.

Related: #9541 updates mobile display ordering to consume these offsets.
No duplicate producer fix found in the open PR/issue search.

Repository-wide validation: `just ci` passed Rust/Tauri Clippy and
formatting, then failed mobile analysis at
`mobile/test/features/search/search_channels_journey_test.dart:933`:
`_RenamingSession.subscribeWithStatus` omits the base method's
`resumeSince` parameter. Mobile files are unchanged from the base
commit. This unrelated failure remains outside this fix.

The first push hook run failed the existing WebSocket throttle test
`a_throttled_sign_in_reconnects_with_fresh_evidence` (connection reset
during sign-in); a subsequent full CLI rerun and the complete normal
push-hook retry passed without source changes. The test uses a
kind-20001 event and does not call the changed builder. All required
push hooks passed.

Signed-off-by: Rocket <0c41329ade659e01801116549bc617351689892a382bc864a1186dc9191293a7@buzz.block.builderlab.xyz>
Co-authored-by: Rocket <0c41329ade659e01801116549bc617351689892a382bc864a1186dc9191293a7@buzz.block.builderlab.xyz>
2026-11-17 14:19:27 -07:00
..