Skip to content

Commit a464e53

Browse files
committed
PuppeteerProvider uninstall: forward install_args to browser-path resolver
``default_uninstall_handler`` derived ``browser_name`` from the caller's ``install_args`` but then called ``_resolve_installed_browser_path`` without forwarding them. The resolver re-runs ``get_install_args`` internally and, when the caller passed an alias that differs from the provider's registered overrides (e.g. ``chrome`` → ``chromium@latest``), picks a different ``browser_name`` than the one we just derived. The subsequent ``parent.name == browser_name`` match against the resolved path then fails silently, skipping the rmtree and leaking the browser cache to disk. Forward the already-resolved ``install_args`` so both derivations stay in sync.
1 parent 7cbe281 commit a464e53

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

abxpkg/binprovider_puppeteer.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,16 @@ def default_uninstall_handler(
824824
# and puppeteer-browsers' own default uniformly.
825825
install_args = list(install_args or self.get_install_args(bin_name))
826826
browser_name = self._browser_name(bin_name, install_args)
827-
resolved = self._resolve_installed_browser_path(str(bin_name))
827+
# Forward install_args so ``_resolve_installed_browser_path`` uses
828+
# the same ``browser_name`` we just derived; otherwise it re-runs
829+
# ``get_install_args`` and can pick up a different alias (e.g.
830+
# caller-passed ``chromium@latest`` vs provider default ``chrome``),
831+
# which would leave the parent.name match below unsatisfied and
832+
# silently skip the rmtree.
833+
resolved = self._resolve_installed_browser_path(
834+
str(bin_name),
835+
install_args=install_args,
836+
)
828837
if resolved is not None:
829838
for parent in Path(resolved).resolve().parents:
830839
if parent.name == browser_name:

0 commit comments

Comments
 (0)