Skip to content

Drop the unused hash parameter from locateArchives - #203

Merged
bcourbage merged 1 commit into
mainfrom
cleanup/archive-locate-drop-unused-parameter
Nov 8, 2026
Merged

bcourbage merged 1 commit into
mainfrom
cleanup/archive-locate-drop-unused-parameter

Conversation

@bcourbage

@bcourbage bcourbage commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

What

locateArchives never read its computed: ArchiveHash.MultiResult parameter. It finds a profile's archives by matching the roots in each archive header. This removes the parameter and the value threaded through to it:

  • locateArchives(profile:unisonDirectory:localHostname:)
  • resetArchiveCandidates and deleteArchiveOffer still run ArchiveHash.computeAll and branch on its failure (the three Reset gates; Delete withholds the offer when it fails), but no longer pass the success value on.
  • Corrects the Reset action's doc comment, which said the hash identifies the profile's files.

Behavior

Unchanged. ArchiveOfferSelectionTests from #201 passes without edits: local pair, ssh root, the three Reset gates, former-hostname archives, and Delete's withheld offer when another profile shares the roots.

Size

Production +9/-9 (the parameter plus the corrected comment), one file. This is step A of the archive cleanup. Step B (reading the profile once instead of twice) is separate and needs these tests as its baseline.

Verified

make test on Heracles: 1549 tests, 0 failures.

🤖 Generated with Claude Code

locateArchives never read the computed hash result; it finds a profile's
archives by matching the roots recorded in each archive header. The hash
computation remains the gate that decides whether a profile can be reset
or whether Delete offers archive removal, so callers still run it and
branch on its failure. Only the unused value stops being passed along.

Also corrects the Reset action's doc comment, which said the hash
identifies the profile's files.

The ArchiveOfferSelectionTests from #201 are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@bcourbage
bcourbage merged commit 00941c6 into main Nov 8, 2026
2 checks passed
@bcourbage
bcourbage deleted the cleanup/archive-locate-drop-unused-parameter branch November 8, 2026 00:46
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