fix: robust provide strategy detection - #3196
Merged
Merged
Conversation
Import.FastProvide* are kubo import knobs, not part of Provide.Strategy nor of IPIP-499, yet detection required them to match a named strategy. applyDefaults wrote the strategy without them, so every repo IPFS Desktop created classified as "Manual" and the tray rendered all three options read-only, over a config the app wrote itself. Revision 7 did the same to existing repos. - detection reads Provide.Strategy alone, and picking an entry in the tray no longer touches Import - the FastProvide preferences become repo defaults next to Provide.Strategy: written for new repos, and filled in key by key by migration revision 8 wherever the user has not set them - content added or pinned now has the blocks under its root announced right away rather than at the next reprovide cycle. Kubo defaults Import.FastProvideDAG to false to keep bulk imports cheap; a desktop node adds a few files at a time and can afford the walk - unit tests pin what applyDefaults and migrateConfig write against the detection the tray depends on
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.
Problem
Quick follow-up to #3194, making the config handling around provide settings more robust.
Provide.StrategyandImport.FastProvide*were treated as one setting, so a config carrying the strategy but not the FastProvide keys read as hand-tuned, and the tray showed Provide Strategy as a read-only "Manual". A repo IPFS Desktop sets up itself lands in exactly that state.Fix
Provide.Strategyalone.FastProvide*are kubo import knobs, not part of the strategy or of IPIP-499DEFAULT_FAST_PROVIDEinsrc/daemon/config.jsA strategy set by hand still shows read-only "Manual", which is what that state is for.