ddidderr fdad162240 fix(peer): write local library index atomically
The local library index used tokio::fs::write directly on the canonical
library_index.json path. That truncates the existing index before writing the
new bytes, so a crash or power loss could leave a zero-length or partial cache.

Write the index through a sibling temp file, sync it, rename it over the
canonical path, and sync the parent directory on Unix. Loading the index also
sweeps a stale temp file before parsing the canonical file. That keeps the
existing cache valid after an interrupted write while still letting a normal
scan rebuild from disk if the canonical index is missing or corrupt.

This follows the existing temp-plus-rename pattern used for version.ini and
install intents. It intentionally does not add locking; local library writes
are already serialized by the peer operation flow.

Test Plan:
just fmt
just test
just clippy

Refs: none
2026-05-16 10:01:34 +02:00
2025-08-27 21:21:01 +02:00
2025-03-02 14:41:08 +01:00
2025-03-02 14:41:08 +01:00

lanspread

Description

Peer-to-peer game library sharing for LAN parties.

  • Peers let users browse and download games from each other
  • they discover each other on the local network via mDNS
  • they exchange library metadata over QUIC

Ships as a Tauri desktop app.

Development

Prerequisites

# install Tauri CLI
cargo install tauri-cli

# install Deno with a package manager or from https://deno.land/

Build or Run

# build
just build

# run
just run
S
Description
No description provided
Readme 152 MiB
Languages
Rust 63.8%
TypeScript 12.6%
CSS 8.9%
Python 7.5%
JavaScript 5.9%
Other 1.2%