Fix an issue that could cause corrupted installs of EvenHub apps, and redirect corrupted installs into the update/reinstall

This commit is contained in:
James Babcock committed 2026-10-25 14:05:36 -07:00
1 parent 99f146529b
commit 247459bf99
7 files changed
+93 -7

No files matched your search

+15
View File
@@ -176,6 +176,21 @@ export function readEvenHubPackageManifestBytes(bytes: Uint8Array): EvenHubManif
}
}
/**
* Delete an installed EHPK that is all zeros, keeping its registry entry and
* icon so the store treats it as missing and offers Reinstall. iOS builds
* before the binary-http.ios.ts copy fix could store a large download that
* way. Returns whether the package was discarded.
*/
export function discardZeroedEvenHubPackage(packageId: string): boolean {
const path = installedEvenHubPackagePath(packageId);
const bytes = readBinaryFile(path);
if (!bytes || bytes.length === 0) return false;
for (let i = 0; i < bytes.length; i++) if (bytes[i] !== 0) return false;
deletePathRecursively(path);
return true;
}
/** Remove the stored EHPK, unpacked runtime files, and registry entry. */
export function uninstallEvenHubPackage(packageId: string): boolean {
const apps = getInstalledEvenHubApps();