Skip to content

Keep LAN hash cache across install moves; name the file in walk errors - #613

Open
aidankinzett wants to merge 1 commit into
masterfrom
fix/lan-hash-cache-on-move
Open

aidankinzett wants to merge 1 commit into
masterfrom
fix/lan-hash-cache-on-move

Conversation

@aidankinzett

Copy link
Copy Markdown
Owner

Problem

The LAN manifest hash cache (HashCache in lan/server.rs) is keyed by absolute file path. Moving a game's install with move_game_install changed every path, so every cached hash missed, and the next peer /manifest request re-hashed the whole game. For a 185 GB install that took about 13 minutes, and the peer's request waited on it.

Separately, one unreadable file fails the whole walk, and the 500 / log line gave only the bare OS error, e.g. os error 225 when Windows Defender blocked a read. It didn't say which file failed.

Changes

  • lan::server::on_install_moved (called at the end of move_game_install) rekeys cache entries under the old folder to the same relative paths under the new folder, persists the cache, then calls spawn_manifest_prep so the first peer request finds the manifest ready. Mtimes are carried over: a same-filesystem rename keeps them, so the entries hit. A cross-device copy changes them, so those files are re-hashed on the next walk, the same as before.
  • walk_game_files_with_hashes prefixes metadata and hash read errors with the file's path relative to the install folder.
  • Unit test for rekey_cache_entries, including a sibling folder that shares a name prefix with the old folder (it must not be moved).

Testing

  • cargo fmt, cargo clippy --all-targets -- -D warnings pass (Windows).
  • cargo test not run locally (Windows; no WSL on this machine). CI's Linux job runs the new test.

🤖 Generated with Claude Code

The LAN manifest hash cache is keyed by absolute path, so moving a game's
install folder made every cached hash miss and the next /manifest request
re-hashed the whole game (185 GB took ~13 min, with the peer waiting on it).
After a move, move_install now calls lan::server::on_install_moved, which
rekeys the cache entries from the old folder to the new one, persists the
cache, and starts a background manifest prep. Mtimes are carried over, so a
same-filesystem rename hits the cache; a cross-device copy changes mtimes
and those files are re-hashed as before.

A single unreadable file fails the whole walk. The error now includes the
file's path relative to the install folder instead of only the OS error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
spool Ready Ready Preview Nov 2, 2026 8:25am UTC

@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch was successfully deployed

1 active deployment
Preview — cdf6b5df Deployed Nov 2, 2026 by vercel[bot]
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