fix: unify playlist item short ID hashing to SHA256#64
Open
fix: unify playlist item short ID hashing to SHA256#64
Conversation
Fixes ISSUE-039: Playlist item short IDs displayed by 'runbox playlist show' now match the IDs used by 'runbox run <id>'. The root cause was two different hashing algorithms: - playlist.rs used DefaultHasher (unstable across Rust versions) - runnable.rs used SHA256 (stable) Changes: - Export stable_short_id from runnable.rs - Update PlaylistItem::short_id() to use the same SHA256-based algorithm as Runnable::PlaylistItem.short_id() - Both now use the format: 'playlist_item\0' + playlist_id + '\0' + index + '\0' + template_id Acceptance criteria met: - runbox playlist show displays same short IDs as runbox list --type playlist - runbox run <short_id> works with IDs shown by runbox playlist show - All playlist item short IDs are stable across Rust versions (SHA256-based) - All tests pass (121 core tests, 53 CLI playlist tests)
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.
Summary
runbox playlist shownow match the IDs used byrunbox run <id>Problem
Two different hashing algorithms were used for playlist item short IDs:
playlist.rs:DefaultHasher(unstable across Rust versions)runnable.rs:SHA256(stable)This caused
runbox run <short_id>to fail with "No runnable found" when using IDs fromrunbox playlist show.Changes
stable_short_idfromrunnable.rsPlaylistItem::short_id()to use the same SHA256-based algorithm asRunnable::PlaylistItem.short_id()playlist_item\0{playlist_id}\0{index}\0{template_id}Acceptance Criteria Verification
runbox playlist showdisplays same short IDs asrunbox list --type playlistrunbox run <short_id>works with IDs shown byrunbox playlist showAll tests pass
Closes ISSUE-039