Files
overleaf-cep/services
Lucie GermainandClaude Fable 5 975cd99871 [github-sync] Surface "project too large" errors instead of hanging (#35183)
* [github-sync] Surface "project too large" errors instead of hanging

A GitHub sync of a project whose total editable text exceeds github-sync's
7MB request body limit would hang silently: the modal stayed on "Importing
and merging changes in GitHub" and then closed with no error.

Root cause was a chain of three issues:

1. github-sync's ErrorMiddleware did not recognise the body-parser
   PayloadTooLargeError, so it fell through to a generic 500.

2. web's _reportError rethrew any non-4xx error instead of responding, and
   several github-sync controller handlers were not wrapped in expressify.
   On Express 4 the rethrow became an unhandled rejection and no HTTP
   response was ever sent, so the browser request hung until the socket died.

3. the frontend read error.data.error without a null check, which threw a
   render-time TypeError when the fetch failed at the network level (as it
   did once the hung request was aborted).

Fixes:
- github-sync: add ProjectTooLargeError and map the body-parser 413 to it.
- web: _reportError always responds (500 for unexpected errors) and every
  controller handler is expressified as a backstop.
- frontend: null-safe error.data?.error, a friendly message for the
  too-large case, and a generic message for server errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [github-sync] Refine project-too-large error copy per content guidance

Apply the content-design system's error-message guidance to the new
github_project_too_large_error string: use a contraction, drop the
redundant "reduce the size of your project" restatement and the formal
"Please", keeping the problem/reason/next-step structure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [github-sync] Use plain string matcher in project-too-large CT test

Address review feedback: prefer a plain string matcher with exact:false
over a regex, per the repo's testing guidance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [github-sync] Link to the file-limits docs from the too-large error

Add a "Learn about GitHub sync file limits" link below the project-too-large
error, pointing to the GitHub synchronization file-limits documentation, so
users can find out what the limits are and how to stay under them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [github-sync] Use rel="noopener noreferrer" on the file-limits docs link

The eslint rule for external docs.overleaf.com links requires
rel="noopener noreferrer" (not just noreferrer) with target="_blank" to
prevent reverse-tabnabbing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
GitOrigin-RevId: 16f701a85fb4ae049c208e03e328ad80049e8579
2026-09-17 11:31:13 +00:00
..