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
Open
fix(cli): report channels list last-write as updated_at, keep created_at as deprecated alias#6472sanjay3290 wants to merge 2 commits into
sanjay3290 wants to merge 2 commits into
Conversation
…data Signed-off-by: Sanjay Ramadugu <sramadugu1@gmail.com>
…_at as deprecated alias Signed-off-by: Sanjay Ramadugu <sramadugu1@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6390.
Problem
buzz channels list(andchannels get) reports the kind 39000 channel-metadata event'screated_atas the channel'screated_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:
updated_at, carrying the same value under an accurate name.created_atas a deprecated alias ofupdated_atfor one release so existing scripts do not break silently.extract_channel_metadataand inbuzz channels list --help.Both call sites (
channels listatchannels.rs:103,channels getat:248) go throughextract_channel_metadata, so the change lands in one place by construction.Removing
created_atoutright 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_atcreated_at_is_deprecated_alias_of_updated_atmissing_created_at_yields_zero_for_both_fieldsAll three call the real
extract_channel_metadatathe binary uses.Deletion probes (both keep the code compiling and produce real failures):
updated_atline → 3 failed.created_atalias line → 2 failed.Gates
At
f7ac2b5d0, clean tree:./scripts/run-tests.sh unit(thejust test-unitpath whencargo-nextestis absent) → all 9 packages pass, 107s.cargo clippy --workspace --all-targets -- -D warnings→ clean.cargo fmt --all -- --check→ clean.just test-integration/just cineed Docker and were not run.