fix: replace ipfs-http-client with kubo-rpc-client #3034
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.
this fixes sporadic "invalid ip address" errors on Windows (and occasionally macOS) caused by a V8 JIT optimization bug corrupting complex regex patterns.
the old
multiaddrpackage usedis-ipwhich relies on a 1,150-character IPv6 regex fromip-regex. under certain conditions, V8's JIT compiler would incorrectly optimize this regex, causing valid IPs like "127.0.0.1" to fail validation.the fix migrates from deprecated packages to their maintained successors:
ipfs-http-client->kubo-rpc-clientipfsd-ctl@10->ipfsd-ctl@16multiaddr->@multiformats/multiaddr@13multiaddr-to-uri->@multiformats/multiaddr-to-urithe new
@multiformats/multiaddruses@chainsafe/is-ipwhich validates IPs with a parser-based approach instead of regex, eliminating the bug.the migration also restores proper daemon output monitoring for migration progress detection by accessing ipfsd-ctl's subprocess streams directly, with runtime checks that log warnings if internals change in future versions.
closes #2329
TODO
since the new packages are ESM-only and ipfs-desktop uses CommonJS, this adds
src/esm-loader.jsto handle dynamic imports at startup.