fix(files): serve the stored offline copy when a live download stalls

Opening a document that was stored for offline use fetched it from the
server first and only fell back to the stored copy when the request
rejected. On a weak or stalled connection the request never rejects, so a
boarding pass already on the phone could spin indefinitely.

With a stored copy, the live download now gets five seconds, request and
body together; after that the stored copy is served and the download is
aborted. A connection that breaks while the body arrives serves the copy as
well. An HTTP error that comes back in time still surfaces over the copy,
and without a stored copy the download waits as long as it always did. The
test file is now formatted and leaves the format baseline.
This commit is contained in:
Maurice
2026-11-26 23:34:22 +01:00
parent 3b42ffa67b
commit b8dffdbb13
3 changed files with 324 additions and 150 deletions
-1
View File
@@ -2121,7 +2121,6 @@
"tests/unit/sync/tripSyncManager.test.ts",
"tests/unit/tripStore.test.ts",
"tests/unit/utils/cleanAmount.test.ts",
"tests/unit/utils/fileDownload.test.ts",
"tests/unit/utils/formatters.test.ts",
"tests/unit/utils/placeFiles.test.ts",
"tests/unit/utils/shellGuard.test.ts",