Add reserved "autosave" restore name for always-newest-autosave - #4
Open
SephReed wants to merge 1 commit into
Open
Add reserved "autosave" restore name for always-newest-autosave#4SephReed wants to merge 1 commit into
SephReed wants to merge 1 commit into
Conversation
`restore` (and its documented autostart recipe, `restore --max-age 24h`) resolves the default session name "latest", which is only ever written by a manual `hyprflow save`. The autosave timer never touches it, so once "latest" has been saved manually even once, it silently shadows every later autosave forever -- the existing fallback-to-newest- autosave logic only triggers when "latest" is missing entirely, not when it's merely stale. `hyprflow restore autosave` now always resolves to the newest autosave-* session regardless of whether "latest" exists, so it can be used directly in an autostart recipe instead.
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
restore(and the documented autostart recipe,restore --max-age 24h) resolves the default session name"latest", which is only ever written by a manualhyprflow save. The autosave timer never touches it, so once"latest"has been saved manually even once, it silently shadows every later autosave forever — the existing fallback-to-newest-autosave logic only fires when"latest"is missing entirely, not when it's merely stale.autosave, that always resolves to the newestautosave-*session regardless of whether"latest"exists, so it can be used directly in an autostart recipe (hyprflow restore autosave --max-age 24h) without this footgun."latest") is completely unchanged.Test plan
cargo build --releasehyprflow restore autosave --dry-runresolves to the newest autosave sessionhyprflow restore --dry-run(no args) still resolves"latest"first, falling back to newest autosave when absent, same as beforeHey, you can probably tell everything above is AI. I just wanted to sign it off. Super easy fix for something I found confusing. I could possibly be more logical if
restore --max-age 24hexcluded old saves, or there was an arg for that. But this seemed like one of the quickest, easiest solutions. Specifically for users who never intend to use the explicit save feature.Cheers :D