Skip to content

Add reserved "autosave" restore name for always-newest-autosave - #4

Open
SephReed wants to merge 1 commit into
isorensen:mainfrom
SephReed:restore-autosave-arg
Open

Add reserved "autosave" restore name for always-newest-autosave#4
SephReed wants to merge 1 commit into
isorensen:mainfrom
SephReed:restore-autosave-arg

Conversation

@SephReed

@SephReed SephReed commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • restore (and the 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 fires when "latest" is missing entirely, not when it's merely stale.
  • Adds a reserved session name, autosave, that always resolves to the newest autosave-* 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.
  • Default behavior (no name, or explicit "latest") is completely unchanged.

Test plan

  • cargo build --release
  • hyprflow restore autosave --dry-run resolves to the newest autosave session
  • hyprflow restore --dry-run (no args) still resolves "latest" first, falling back to newest autosave when absent, same as before

Hey, 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 24h excluded 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

`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.
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.

1 participant