Skip to content

Conversation

@mfts
Copy link
Owner

@mfts mfts commented Nov 12, 2025

Summary by CodeRabbit

  • Improvements
    • Enhanced download operation reliability by extending timeout thresholds, allowing adequate time for file transfers to complete successfully without unexpected interruptions during longer operations.

@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
papermark Ready Ready Preview Comment Nov 12, 2025 2:05pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

Walkthrough

This PR modifies Next.js API route configurations in the download links directory. One route's maxDuration timeout is increased from 180 to 300 seconds, while another route receives a new maxDuration configuration set to 300 seconds.

Changes

Cohort / File(s) Change Summary
API route timeout configuration
pages/api/links/download/dataroom-document.ts, pages/api/links/download/index.ts
Extended and added maxDuration configuration to 300 seconds across download API routes; dataroom-document.ts increased from 180 to 300, index.ts newly configured with 300

Possibly related PRs

  • PR #1729: Modifies Next.js API route export config.maxDuration to adjust per-route request timeouts
  • PR #1812: Extends Next.js API route config.maxDuration from 180 to 300 seconds across multiple files in the same download routes directory

Pre-merge checks

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: extending maxDuration for download functions across two API routes.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 02259a2 and f25c0fd.

📒 Files selected for processing (2)
  • pages/api/links/download/dataroom-document.ts (1 hunks)
  • pages/api/links/download/index.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
pages/api/links/download/index.ts (4)
pages/api/links/download/dataroom-document.ts (1)
  • config (12-14)
pages/api/links/download/bulk.ts (1)
  • config (12-15)
pages/api/links/download/dataroom-folder.ts (1)
  • config (13-15)
pages/api/mupdf/annotate-document.ts (1)
  • config (14-16)
🔇 Additional comments (2)
pages/api/links/download/index.ts (1)

11-14: Good addition for consistency and proper timeout configuration.

Adding the maxDuration config with 300 seconds aligns this route with other download endpoints and provides adequate time for file downloads with watermarking. The explanatory comment is helpful.

Similar to the suggestion for dataroom-document.ts, consider verifying whether a memory configuration should also be specified. This route buffers files in memory (lines 198-209), so explicit memory limits might help prevent out-of-memory errors for large files, especially given the extended execution time.

pages/api/links/download/dataroom-document.ts (1)

12-14: Consider adding memory configuration to prevent out-of-memory errors.

The route buffers entire PDF files in memory at lines 246 and 278 (via arrayBuffer() and Buffer.from(pdfBuffer)). While bulk.ts specifies memory: 2048, dataroom-document.ts currently lacks this configuration. Adding explicit memory limits will help prevent OOM errors when handling large files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mfts mfts merged commit 79b59f7 into main Nov 12, 2025
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 12, 2025
@mfts mfts deleted the fix/download branch November 19, 2025 11:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants