Fix/project import 413 error feedback#2245
Open
zarch wants to merge 3 commits intofrangoteam:masterfrom
Open
Conversation
added 3 commits March 10, 2026 23:27
When body-parser rejected a request exceeding the configured size limit (apiMaxLength), it silently returned HTTP 413 with no application-level log entry. Only the morgan access log showed the status code, making the root cause invisible in server logs. Added a runtime.logger.error() call so operators can identify oversized import attempts without inspecting raw access logs.
The save() error handler used a hardcoded generic message regardless of the HTTP status code, hiding the actual cause from the user. Importing a large project file (>100 MB) triggered a 413 from body-parser, but the UI only showed "Project save failed!" with no actionable information. Delegated to the existing notifySaveError() which already handles 401 and 413 correctly. Added a status 0 branch (connection aborted mid-upload) that displays the configured server limit when apiMaxLength is known. Extended ServerSettings with apiMaxLength so the value from /api/settings is available at the point of error handling.
… functions theme.scss used mat.m2-define-* functions and mat.\$m2-* palette variables introduced in Angular Material 17, while the installed package is 16.2.13. This caused an "Undefined function" sass compilation error that prevented the Angular client from being built at all. Replaced all m2- prefixed identifiers with their Material 16 equivalents (mat.define-* / mat.\$*-palette).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Description
Problem: Importing a large project file (≥ 184 MB in the reported case) through the FUXA UI failed silently. The interface showed only a generic notification with
Project save failed!with no indication of the actual cause, and the server logs contained no application-level error entry — only the raw HTTP access log linePOST /api/project 413.Three separate issues combined to produce this behaviour:
Server silent on 413: In
server/api/index.jsthe Express error handler forentity.too.largereturned the 413 response but never calledruntime.logger.error(). The rejection was invisible in application logs.Frontend discarded HTTP status: In
client/src/app/_services/project.service.ts, thesave()method had its own inline error handler that always showed the translatedmsg.project-save-errorstring, ignoring the HTTP status code entirely. The existingnotifySaveError()helper already handled 401 and 413 correctly (surfacing the server message for 413, and a hint for status 0 / connection abort), butsave()bypassed it.Angular client could not be rebuilt:
client/src/theme.scssusedmat.m2-define-*functions andmat.$m2-*palette variables introduced in Angular Material 17, while the installed package is 16.2.13. This caused an "Undefined function" Sass compilation error that prevented any rebuild of the client bundle.Changes:
server/api/index.js: addedruntime.logger.error()in the 413 error handler so the rejection appears in application logs alongside the HTTP access log entry.client/src/app/_services/project.service.ts: replaced the inline error handler insave()with a call tonotifySaveError(err). Added astatus === 0branch innotifySaveError()for browsers that abort the connection mid-upload rather than receiving the 413 cleanly. ExtendedServerSettingswithapiMaxLengthso the configured limit is available for that message.client/src/theme.scss: replaced allm2-prefixed Sass identifiers with their Angular Material 16 equivalents (mat.define-*/mat.$*-palette) to restore the ability to build the client. I keep these change in a separate commit because I do not know if you are in a transition phase from Angular Material 16 to Angular Material 17, but without this fix I was not able to test it locally. So in case let me know and I rebase it without this last commit.🧪 Type of Change
Please mark the relevant option:
🚫 Build Artifacts Check
Please confirm:
/client/dist🔍 Checklist
📝 Additional Notes
The immediate trigger for the 413 is the default
apiMaxLengthof100mbdefined inserver/api/index.js. To import a project larger than 100 MB without changing source code, add the following line toserver/_appdata/settings.js:Browser behaviour for large uploads is not standardised. Chrome typically receives the 413 response cleanly (the
status === 413branch fires and shows the server message verbatim). Firefox and some other clients abort the TCP connection before receiving the response (thestatus === 0branch fires and shows the configured limit as a hint). Both paths now produce an actionable message instead of the generic fallback.The server log will now show:
The final result on the ui is:
