Skip to content

fix(cli): report channels list last-write as updated_at, keep created_at as deprecated alias - #6472

Open
sanjay3290 wants to merge 2 commits into
block:mainfrom
sanjay3290:spark2/channels-updated-at
Open

fix(cli): report channels list last-write as updated_at, keep created_at as deprecated alias#6472
sanjay3290 wants to merge 2 commits into
block:mainfrom
sanjay3290:spark2/channels-updated-at

Conversation

@sanjay3290

Copy link
Copy Markdown

Fixes #6390.

Problem

buzz channels list (and channels get) reports the kind 39000 channel-metadata event's created_at as the channel's created_at. Kind 39000 is addressable/replaceable, so that timestamp is overwritten on every metadata update. The field therefore reports the last metadata write, not the channel's creation. The channel's birth time is not recoverable from a replaceable event, so it cannot be fixed by finding a better source.

Change

Name the field honestly instead of guessing a birth time:

  • Add updated_at, carrying the same value under an accurate name.
  • Keep created_at as a deprecated alias of updated_at for one release so existing scripts do not break silently.
  • Document the semantics on extract_channel_metadata and in buzz channels list --help.

Both call sites (channels list at channels.rs:103, channels get at :248) go through extract_channel_metadata, so the change lands in one place by construction.

Removing created_at outright is out of scope for this PR — that is the follow-up once the deprecation window closes.

Tests

Three tests were written first and watched fail, then the fix was applied (two commits, tests before fix):

  • updated_at_carries_kind_39000_created_at
  • created_at_is_deprecated_alias_of_updated_at
  • missing_created_at_yields_zero_for_both_fields

All three call the real extract_channel_metadata the binary uses.

Deletion probes (both keep the code compiling and produce real failures):

  • Remove the updated_at line → 3 failed.
  • Remove the created_at alias line → 2 failed.

Gates

At f7ac2b5d0, clean tree:

  • ./scripts/run-tests.sh unit (the just test-unit path when cargo-nextest is absent) → all 9 packages pass, 107s.
  • cargo clippy --workspace --all-targets -- -D warnings → clean.
  • cargo fmt --all -- --check → clean.

just test-integration / just ci need Docker and were not run.

…data

Signed-off-by: Sanjay Ramadugu <sramadugu1@gmail.com>
…_at as deprecated alias

Signed-off-by: Sanjay Ramadugu <sramadugu1@gmail.com>
@sanjay3290
sanjay3290 requested a review from a team as a code owner August 21, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

channels list created_at is last-state-change, not channel creation

1 participant