Repository navigation
fix(cli): don't panic in tauri info on unparseable Node.js package versions - #16058
Open
Raaif-Yousuf wants to merge 1 commit into
Open
Raaif-Yousuf wants to merge 1 commit into
Raaif-Yousuf wants to merge 1 commit into
Conversation
…versions `nodejs_section_item` unwrapped `semver::Version::parse` on the installed version to build the "(outdated, latest: ...)" hint. That version is scraped from package manager output and isn't always valid semver: for pnpm peer-suffixed store directories like `@tauri-apps+plugin-http@2.6_<hash>` the regex captures `2.6`, and `tauri info` panics. Move the suffix into `outdated_suffix`, which returns no suffix when either version fails to parse. Closes tauri-apps#16033
This branch has not been deployed
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.
Closes #16033
tauri infobuilds the "(outdated, latest: ...)" hint by callingsemver::Version::parse(..).unwrap()on the installed version. For pnpm, that version comes from running a regex overpnpm list --parseable. With a peer-suffixed store directory like@tauri-apps+plugin-http@2.6_3b0f9b4c..., the_ends the match and the captured version is2.6, so the unwrap panics andtauri infoaborts.I moved the suffix logic into a small
outdated_suffixhelper. It returns no hint when either version doesn't parse, so the command no longer panics. The package is still listed with whatever version was detected. This PR doesn't change how the version is extracted from the pnpm path.2.6), outdated, and up-to-date versions.changes/fix-cli-info-pnpm-version-panic.md(patch:bugfortauri-cliand@tauri-apps/cli)cargo test -p tauri-cli(63 unit + 1 integration passed),cargo clippy -p tauri-cli --all-targetsandcargo fmt --checkare clean