alyssaxuu/screenity · warning · Error

Uploader paused

Error message

Uploader paused

What it means

Guard in BunnyTusUploader.write(): a chunk arrived while this.isPaused was true, so the uploader refuses the write to preserve tus protocol ordering. The caller must resume the uploader before delivering further chunks.

Source

Thrown at src/pages/CloudRecorder/bunnyTusUploader.js:1272

        this.debugLog("save-upload-meta failed (non-blocking)", { error: String(err) }),
      );
    } else {
      this.debugLog("Skipping save-upload-meta because user token is missing", {
        mediaId: this.mediaId,
        uploadUrl: this.uploadUrl,
        signature: this.signature,
        expires: this.expires,
      });
    }
  }

  async write(chunk) {
    if (this.isFinalizing) {
      this.bytesLostAfterFinalize += chunk?.size || 0;
      this.setUploaderError("write-after-finalize");
      throw new Error("Cannot write during finalization");
    }
    if (this.isPaused) throw new Error("Uploader paused");
    if (!this.uploadUrl) throw new Error("Uploader not initialized");

    if (this.status === "error") {
      throw new Error(`Uploader in error state: ${this.error}`);
    }

    await this.checkAuthExpiration();
    this.status = "uploading";
    if (!this.hasEmittedClientStarted) {
      this.hasEmittedClientStarted = true;
      this.emitTelemetry("upload_client_started");
    }

    for (let i = 0; i < chunk.size; i += this.CHUNK_SIZE) {
      const subChunk = chunk.slice(i, i + this.CHUNK_SIZE);
      this.chunkQueue.push(subChunk);
      this.queuedBytes += subChunk.size;
      this.totalBytes += subChunk.size;

View on GitHub (pinned to 512606387b)

Solutions

  1. Buffer or drop the chunk and resume the uploader before continuing the stream
  2. Ensure the pause control (UI or backpressure) stops the chunk source, not just the uploader
  3. Catch this in the writer pipeline and retry the chunk after resume

Example fix

// before
await uploader.write(chunk); // throws if paused
// after
if (uploader.isPaused) { pendingChunks.push(chunk); } else { await uploader.write(chunk); }
Defensive patterns

Strategy: try-catch

Validate before calling

if (uploader.isPaused) { queue.push(chunk); return; }
await uploader.write(chunk);

Try / catch

try {
  await uploader.write(chunk);
} catch (e) {
  if (e.message === "Uploader paused") {
    queue.push(chunk); // replay after resume()
    uploader.once("resumed", drainQueue);
  }
}

Prevention

When it happens

Trigger: Calling write() while the user (or code) paused the uploader via pause(); typically from an active recorder dataavailable callback during a pause.

Common situations: User pauses recording/upload from the UI while the recorder keeps producing chunks; pause/resume state desync between recorder controls and uploader.

Related errors


AI-assisted analysis of alyssaxuu/screenity@512606387b (2026-09-02). Data as JSON: /api/errors/c4b1148a4f34753f. Report an issue: GitHub.