From cfe9ecc59f022d2f2b69e204abcc5a57e34db6f5 Mon Sep 17 00:00:00 2001 From: Tiago Neves Date: Mon, 19 Oct 2026 03:12:11 +0100 Subject: [PATCH] Add a PROPFIND-specific regression test for the Nextcloud retry (BIT-31498). CloudClient.list() already retries transient statuses via the shared call() method (fixed for downloads in BIT-31491), so the 503 reported here is already covered by that retry logic. This test exercises the PROPFIND path directly so the fix for this ERRSIG stays covered on its own. Paperclip-Issue: BIT-31498 Paperclip-Run: 0564ac90-43c8-430b-9f93-b580f6775efa --- apps/api/test/archive.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/apps/api/test/archive.test.ts b/apps/api/test/archive.test.ts index f47505d..5f44d16 100644 --- a/apps/api/test/archive.test.ts +++ b/apps/api/test/archive.test.ts @@ -329,6 +329,26 @@ describe("CloudClient retries transient failures", () => { await rm(dir, { recursive: true, force: true }); } }); + + it("retries a 503 blip on a PROPFIND (BIT-31498) and succeeds, instead of failing the whole walk", async () => { + const multistatus = ` +/remote.php/dav/files/peter/FPA/Fotos/ + "abc"10HTTP/1.1 200 OK + +`; + let calls = 0; + const fetchImpl: typeof fetch = async (input) => { + const url = new URL(String(input)); + const who = whoami(url); + if (who) return who; + calls++; + return calls <= 2 ? new Response(null, { status: 503 }) : new Response(multistatus, { status: 207 }); + }; + const client = new CloudClient({ baseUrl: "https://cloud.test", username: "peter", password: "pw" }, fetchImpl); + const { self } = await client.list("/FPA/Fotos"); + expect(self.fileId).toBe("10"); + expect(calls).toBe(3); + }); }); interface Node {