mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 05:25:40 +09:00
feat(desktop): prefer the bundled renderer, own update prompts (#3341)
This commit is contained in:
1 parent
7a5b9a0ded
commit
5072488f1e
33 files changed
+2197
-113
No files matched your search
@@ -41,6 +41,9 @@ function loadAppImageUpdate(env = {}, overrides = {}, requireImpl = require) {
|
||||
require: requireImpl,
|
||||
console,
|
||||
Buffer,
|
||||
AbortController,
|
||||
setTimeout,
|
||||
clearTimeout,
|
||||
fetch,
|
||||
Error,
|
||||
Number,
|
||||
@@ -261,6 +264,29 @@ describe('AppImageUpdate in-place replacement', () => {
|
||||
assert.deepEqual(stagingLeftovers(install.applications), []);
|
||||
});
|
||||
|
||||
test('a download that stops sending data fails instead of hanging and leaves nothing staged', async () => {
|
||||
const install = createInstall();
|
||||
const appImageUpdate = loadAppImageUpdate({APPIMAGE: install.installedPath});
|
||||
const resolved = appImageUpdate.resolveAppImageTarget();
|
||||
const silent = new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(NEW_BYTES.subarray(0, 4));
|
||||
},
|
||||
});
|
||||
|
||||
await assert.rejects(
|
||||
appImageUpdate.stageAppImageUpdate({
|
||||
fetchImpl: async () => new Response(silent, {headers: {'content-length': String(NEW_BYTES.length)}}),
|
||||
target: resolved.target,
|
||||
url: 'https://pkgs.invalid/appimage',
|
||||
expectedSha256: NEW_SHA256,
|
||||
stallMs: 30,
|
||||
}),
|
||||
/sent no data for 30 ms/,
|
||||
);
|
||||
assert.deepEqual(stagingLeftovers(install.applications), []);
|
||||
});
|
||||
|
||||
test('refuses to swap when the download does not match the published checksum', async () => {
|
||||
const install = createInstall();
|
||||
const appImageUpdate = loadAppImageUpdate({APPIMAGE: install.installedPath});
|
||||
|
||||
Reference in new issue
Block a user