get icon indicating copy to clipboard operation
get copied to clipboard

downloadArtifact creates a directory in /tmp but does not remove it

Open rde2 opened this issue 2 months ago • 0 comments

downloadArtifact calls validateArtifact to check the sha256 sums of a cached or newly downloaded file. It uses the download method internally to fetch the SHASUMS256 file and that also calls validateArtifact.

validateArtifact when called for SHASUMS256 starts by creating a new electron-download-xxxxxx directory in /tmp but then takes no further action:

return await withTempDirectoryIn(artifactDetails.tempDirectory, async (tempFolder) => {
    // Don't try to verify the hash of the hash file itself
    // and for older versions that don't have a SHASUMS256.txt
    if (!artifactDetails.artifactName.startsWith('SHASUMS256') &&

As a consequence the newly created directory is not removed.

Additionally the tempDirectory setting in artifactDetails is not used for this directory:

            shasumPath = await _downloadArtifact({
                isGeneric: true,
                version: artifactDetails.version,
                artifactName: 'SHASUMS256.txt',
                downloadOptions: artifactDetails.downloadOptions,
                cacheRoot: artifactDetails.cacheRoot,
                downloader: artifactDetails.downloader,
                mirrorOptions: artifactDetails.mirrorOptions,
                // Never use the cache for loading checksums, load
                // them fresh every time
                cacheMode: ElectronDownloadCacheMode.Bypass,
            });

The argument this download call should copy tempDirectory from artifactDetails

rde2 avatar Dec 03 '25 11:12 rde2