From d63a972591120d8506bed90cdd4d143f5b3abd1d Mon Sep 17 00:00:00 2001 From: Sucukdeluxe <259325684+Sucukdeluxe@users.noreply.github.com> Date: Thu, 22 Oct 2026 02:36:28 +0200 Subject: [PATCH] Keep CloudDrop upload logs in one document up to 4 MB Logs were split into a new CloudDrop document every 700 KB, so a session log of about 1 MB appeared as two files. CloudDrop accepts text documents up to 5 MB, so the limit is now 4 MB and the response limit of the log API leaves room for JSON-escaped paths. Co-Authored-By: Claude Opus 5.5 --- lib/cloud-log-sync.js | 2 +- lib/clouddrop-log-api.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cloud-log-sync.js b/lib/cloud-log-sync.js index 33636a1..eebbbc0 100644 --- a/lib/cloud-log-sync.js +++ b/lib/cloud-log-sync.js @@ -5,7 +5,7 @@ const { EventEmitter } = require('node:events'); const { ClouddropLogApi, CloudLogError } = require('./clouddrop-log-api'); const { iterateUploadLogEntries } = require('./upload-log'); -const MAX_DOCUMENT_BYTES = 700000; +const MAX_DOCUMENT_BYTES = 4000000; const hash = value => createHash('sha256').update(value).digest('hex'); const validId = value => typeof value === 'string' && /^[a-zA-Z0-9_-]{1,100}$/.test(value); const blocksRetry = code => ['INVALID_KEY', 'ACCESS_DENIED', 'UNRESTRICTED_KEY_REQUIRED', diff --git a/lib/clouddrop-log-api.js b/lib/clouddrop-log-api.js index 8f17b21..a3c99a4 100644 --- a/lib/clouddrop-log-api.js +++ b/lib/clouddrop-log-api.js @@ -31,7 +31,7 @@ class ClouddropLogApi { let size = 0; for await (const chunk of response.body) { size += chunk.length; - if (size > 2 * 1024 * 1024) { + if (size > 10 * 1024 * 1024) { response.body.destroy(); throw new CloudLogError('RESPONSE_TOO_LARGE'); }