From ff89ea106082673024bb8cbea34a5912abe07c9f Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Thu, 2 Apr 2026 10:15:26 -0400 Subject: [PATCH 1/2] docs: add FAQ entry about the 32 MB request size limit Document the 32 MB per-request size limit and explain that plugin-pipe v0.6.0+ compresses requests automatically, effectively raising the limit to ~60-300 MB for text data. Also notes that compression is less effective for base64 binary data and describes how to compress manually when not using the plugin. Relates to #148. Co-Authored-By: Claude Opus 4.6 (1M context) --- pages/faq.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/pages/faq.js b/pages/faq.js index 5d97698..cfb5ea1 100644 --- a/pages/faq.js +++ b/pages/faq.js @@ -182,6 +182,50 @@ export default function FAQ() { active only while you are collecting data. + + + Yes. DataPipe has a 32 MB limit on the size of a + single request. This limit is enforced by the server infrastructure + and cannot be increased. Most experiment data is well under this + limit — a typical jsPsych dataset is 50 KB to 5 MB. + + + If you are using version 0.6.0 or later of the{" "} + + @jspsych-contrib/plugin-pipe + {" "} + plugin, request bodies are automatically compressed with gzip before + sending. Text data (JSON, CSV) typically compresses by 2–10x, which + effectively raises the upload limit to roughly 60–300 MB for most + experiment data. Compression is enabled by default and requires no + configuration. + + + Compression is less effective for binary data sent via the base64 + endpoint (e.g., video or audio recordings), because binary data does + not compress as well as text. If you need to send individual files + larger than about 25 MB through the base64 endpoint, they may still + exceed the limit even after compression. + + + If you are sending data without the plugin (e.g., using fetch + directly), you can compress the request body yourself using the + browser's{" "} + + CompressionStream API + {" "} + and setting the Content-Encoding: gzip header. The + server will decompress the body automatically. + + When enabled, DataPipe assigns condition numbers sequentially. From 67b4e2e4c64b3c47d0f0a6207d2aeff18d8f1697 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Thu, 2 Apr 2026 11:41:26 -0400 Subject: [PATCH 2/2] fix: resolve race condition in get-condition error log test The previous test triggers a writeLog that lands after the HTTP response. Wait for that write before deleting the log doc to prevent stale counts. Co-Authored-By: Claude Opus 4.6 (1M context) --- functions/src/__tests__/get-condition-emulator.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/functions/src/__tests__/get-condition-emulator.test.js b/functions/src/__tests__/get-condition-emulator.test.js index 0e49529..d23172c 100644 --- a/functions/src/__tests__/get-condition-emulator.test.js +++ b/functions/src/__tests__/get-condition-emulator.test.js @@ -74,6 +74,8 @@ describe("getCondition", () => { it("should increment the error log for an experiment when errors are caught", async () => { const db = getFirestore(); + // Wait for any pending logError writes from previous tests to land before deleting + await waitForLog(db, "testexp", "logError", 1); await db.collection("logs").doc("testexp").delete(); await getCondition({ experimentID: "testexp" });