Repository navigation
feat(locallibrary): store sync and snapshot reads in the sidecar, one resolver, one progress event - #309
Merged
Conversation
… the interop plugin
…the sidecar Planned as these commits, folded into one because they share files: - fix(locallibrary): parse addresses before the browser gets them - refactor(loclib-plugin): one definition of the progress events - feat(locallibrary): read a snapshot's library from the sidecar and plugins - feat(locallibrary): store.serve and store.fetch in the sidecar
bnb
previously approved these changes
Oct 30, 2026
SizeCompared with main. KiB are 1,024 bytes.
|
# Conflicts: # apps/locallibrary/TODO.md # apps/locallibrary/src/rpc/methods.rs
botandbang
enabled auto-merge
November 1, 2026 17:59
bnb
previously approved these changes
Nov 1, 2026
Rust coverageFrom run 62. Both are held to the thresholds in .cargo/config.toml.
|
bnb
approved these changes
Nov 1, 2026
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.
What and why
The sidecar gains three methods.
store.serveserves the store to another computer until it's cancelled. It sends aservenotification{id, event}for each thing that happens (readywith the share code,connected,refused,done) and answers with how much it sent.store.fetch {code, libraries?, local_only?, dry_run?}copies the snapshots the other store has and this one lacks. Both work likestore serveandstore fetch. They're in builds withpeers, andinitializelists apeerscapability.snapshot.library {snapshot, offset?, limit?}reads the library a drive had when a snapshot was taken, paged likedrive.library. Plugins withstore:readmay call it. To support the notification, a method'sCallcan now send one about its own request.docs/rpcis regenerated and only adds definitions.docs/sidecar.mddescribes the new methods.The progress event has one definition, in loclib-plugin's protocol. The sidecar re-exports it, and
ProgressEvent::newbuilds it from a coalesced report in both the sidecar and the plugin SDK. The wire bytes andschema.jsonare unchanged, and a new test pins the bytes.opener::web_addressparses the address now. It goes throughnet::public, which returns the parsed URL, and refuses a user name or password. The browser gets the parsed form. Addresses with credentials or on this computer or its network are refused.There is now one path resolver,
loclib_model::paths::resolved, withwithout_verbatim_prefixbeside it. locallibrary'sfsutilanddevicere-export them. The interop plugin drops its copy and itsduncedependency, so it strips Windows'\\?\prefix the way the host does for drive roots.loclib-plugin's README now lists the error kinds the host really shows as its own.
apps/locallibrary/TODO.mdloses two finished items.Fixes LOC-42
Fixes #142
Fixes LOC-29
Fixes #129
Fixes LOC-31
Fixes #131
Fixes LOC-30
Fixes #130
Fixes LOC-16
Fixes #113
Fixes LOC-19
Fixes #116
How it was tested
cargo fmt --check, andcargo clippy --all-targets -- -D warningsfor locallibrary, locallibrary-cli, loclib-plugin, locallibrary-plugin-interop and loclib-model.write.rsand loclib-plugin's manifest test); bnb/property-fixes fixes both test models.rpc::the_contract_in_docs_is_currentpassed after the progress change with no bless (the schema didn't change), then was blessed for the new methods and passes.a_store_is_served_and_fetched_through_the_sidecarpassed 10 of 10 stress runs, twice.ProgressEventfield order swapped, the user and password check removed,snapshot_libraryignoringoffset, the notification renamed,resolvednot following links, and thecancel_methodcall removed.without_verbatim_prefixhas a#[cfg(windows)]body).Checklist
apps/locallibrary/CHANGELOG.mdhas a line under Unreleased, if people using it will noticedocs/and--helpstill say what the code does (apps/locallibrary/docs/rpc/too, for a sidecar change)