winget uninstall leaves tracking catalog rows when the package was correlated through the tracking catalog
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with RecordUninstall in src/AppInstallerCLICore/Workflows/UninstallFlow.cpp and trace how the correlated installed version’s ID and source are passed to PackageTrackingCatalog::RecordUninstall in src/AppInstallerRepositoryCore/PackageTrackingCatalog.cpp. Read the linked CompositeSource.cpp methods to understand the ID/source behavior, then find or add coverage for the tracking-correlated uninstall case. Done when uninstall removes the package’s rows from installed.db, preventing later ARP entries with the same product code from being correlated to it.
索引モデルが issue の本文から書いたものです。
説明
Relevant area(s)
WinGet CLI
Relevant command(s)
winget uninstall
Brief description of your issue
When the installed (ARP) entry was correlated to the available package through the source's tracking catalog, winget uninstall reports success but leaves that package's rows in the tracking catalog (installed.db). Any later ARP entry with the same product code is then correlated to the old package again.
From the source (v1.29.380; the same code is on master today):
RecordUninstallseedsUninstallCorrelatedSourceswithGetInstalledVersion(package)first (UninstallFlow.cpp#L442-L463).- For a tracking-correlated package, that installed version is a
CompositeInstalledVersion. ItsGetSource()returns the tracking (remote) source (CompositeSource.cpp#L313-L322), but itsGetProperty(Id)returns the base installed version's id, i.e. the ARP-derived id such asARP\User\X64\<Key>(CompositeSource.cpp#L292-L301). - So the first item is {ARP-derived id, winget source}. The available package from that same source is then skipped by the same-source check (UninstallFlow.cpp#L39-L61), and
PackageTrackingCatalog::RecordUninstalllooks up the ARP-derived id, matches nothing and removes nothing (PackageTrackingCatalog.cpp#L292-L309).
Steps to reproduce
- Start with tracking-catalog rows for a package
<Id>(sourcewinget) whose recorded product codes include a plain ARP key name<Key>, and no ARP entry named<Key>. Seen withqup1010.FilePilot: its rows for 1.0.5 and 1.0.7 record product codefilepilot(from the ProductCode collision in microsoft/winget-pkgs#448131). - Create a per-user ARP entry
HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\<Key>withDisplayName,Publisher,DisplayVersion, andUninstallString=QuietUninstallString=cmd /c reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall\<Key>" /f. winget list --id <Id> --exactshows the entry as<Id>.winget uninstall --id <Id> --exact --source winget --silent- Check a copy of
%LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Microsoft.Winget.Source_8wekyb3d8bbwe\installed.dbfor manifest rows of<Id>.
Expected behavior
<Id>'s rows are removed from the tracking catalog, so a later ARP entry with the same product code is no longer correlated to <Id>.
Actual behavior
Successfully uninstalled (exit code 0). The log shows the uninstall string ran, and the ARP entry is gone. All of <Id>'s rows are still in installed.db, which the uninstall did not write to. When another product later creates an ARP entry with the same key name, winget list --id <Id> --exact again shows it as <Id> with an upgrade available.
I have only verified this case. Reading the code, any uninstall where the installed version was correlated through the tracking catalog would leave its rows behind.
Environment
Windows Package Manager v1.29.380
Windows: Windows.Desktop v10.0.26300.9818
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.29.380.0
- 主要言語
- C++
- スター
- 26.6k
- フォーク
- 1.8k
- 平均マージ
- 3日 10時間
- マージ済み PR(30日)
- 41
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/winget-cli のほかの issue
-
Issue-Docs Needs-Triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
microsoft/winget-cli#6692 ·
メンテナーはふだん 2 日以内に返信
-
Issue-Docs Possible-Duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
microsoft/winget-cli#6493 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Issue-Feature
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/winget-cli#6427 ·
メンテナーはふだん 2 日以内に返信
-
Issue-Docs msstore
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
microsoft/winget-cli#6331 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Command-Source Issue-Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/winget-cli#6148 ·
メンテナーはふだん 2 日以内に返信
microsoft/winget-cli の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
stratum-mining/sv2-tp#167 ·
メンテナーはふだん 1 日以内に返信
-
Sign up button opens the Sign in page instead of the Sign up page for Enterprise edition serversオープンauth bug ui/ux
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
MerginMaps/mobile#4795 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
HarperFast/rocksdb-js#1118 ·
メンテナーはふだん 1 日以内に返信
-
bug triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
26.04 bug dark-mode Easy Hack impress symptom: visual
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
CollaboraOnline/online#16421 · コメント 1 件 ·