Summary
The Deno auto-update path downloads and verifies the new runtime successfully, then attempts to replace the existing binary with:
tokio::fs::rename(&tmp_path, path).await?
On Windows, renaming a file over an existing destination does not replace it. As a result, an existing installation can keep its outdated deno.exe even after a newer version has been downloaded.
The affected code is in src/integrations/youtube/deno.rs at the final installation step.
Impact
This affects existing Windows installations when Deno needs an update:
- Reverbic detects that the managed Deno version is below the minimum required by yt-dlp.
- It downloads and validates the latest Deno release.
- Replacing the old
deno.exe fails because the destination already exists.
- The old runtime remains installed.
- YouTube resolution may continue failing if the current yt-dlp version requires the newer Deno runtime.
Fresh installs are not affected because no destination binary exists yet.
Expected behavior
A managed Deno update should reliably replace the previous runtime on Windows while preserving a working binary if the replacement fails.
Suggested fix
Use a replace strategy that supports rollback:
- Download and validate the new binary to a temporary path.
- Rename the current runtime to a backup path, if it exists.
- Rename the temporary binary into the runtime path.
- Remove the backup after success.
- Restore the backup if installing the new binary fails.
This avoids deleting the existing runtime before the replacement is ready and preserves recovery if any filesystem operation fails.
Verification
On Windows, place an older deno.exe at the managed binary path, trigger update_if_outdated(), and verify that the installed version changes. Also verify that an interrupted replacement restores the previous executable.
Summary
The Deno auto-update path downloads and verifies the new runtime successfully, then attempts to replace the existing binary with:
On Windows, renaming a file over an existing destination does not replace it. As a result, an existing installation can keep its outdated
deno.exeeven after a newer version has been downloaded.The affected code is in
src/integrations/youtube/deno.rsat the final installation step.Impact
This affects existing Windows installations when Deno needs an update:
deno.exefails because the destination already exists.Fresh installs are not affected because no destination binary exists yet.
Expected behavior
A managed Deno update should reliably replace the previous runtime on Windows while preserving a working binary if the replacement fails.
Suggested fix
Use a replace strategy that supports rollback:
This avoids deleting the existing runtime before the replacement is ready and preserves recovery if any filesystem operation fails.
Verification
On Windows, place an older
deno.exeat the managed binary path, triggerupdate_if_outdated(), and verify that the installed version changes. Also verify that an interrupted replacement restores the previous executable.