[GH-ISSUE #5025] [Feature]: Remove the 1 MiB JavaScript cap from Personal Extensions #2778

Closed
opened 2026-10-21 05:55:20 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Aug 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5025

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

Personal Extensions currently reject Browser JavaScript (js) and Server JavaScript (serverJs) once either field exceeds 1,048,576 UTF-8 bytes. The same hard cap applies regardless of source, so an extension authored locally by the user—or created as a disabled draft for them—can be rejected even though the user explicitly owns and reviews that code.

A fixed 1 MiB source ceiling is too restrictive for bundled or otherwise substantial extensions. It also makes local authoring, import, editing, backup/restore, and re-import behavior unnecessarily fragile.

Proposed solution

Remove the hard-coded 1 MiB validation cap from Personal Extension JavaScript source.

  • Allow Browser js and Server serverJs larger than 1 MiB to be created, saved, imported, restored, and re-imported without rejection solely because of this per-field cap.
  • Apply the behavior consistently across user/Professor Mari drafts, External Extension imports, edits, revisions, and profile restore paths.
  • Audit import and transport limits so they do not silently recreate the same arbitrary source-size restriction; retain defensible archive, request, and runtime guards with clear errors.
  • Preserve disabled-by-default behavior, exact-hash approval, capability prompts, privileged/external import gates, and browser/server sandbox boundaries.
  • Keep independent safety limits for runtime protocol messages and private extension storage where they protect a distinct boundary; this request is specifically about the arbitrary 1 MiB executable-source ceiling.
  • Add regression coverage for Browser and Server extension source larger than 1 MiB through create, update, import, and restore paths.

Alternatives considered

Raising the cap to another fixed value would only move the same failure point. A configurable cap would still surprise locally authoring users and create inconsistent portability between installations. Boundary-specific transport and decompression guards are preferable to rejecting an otherwise valid extension solely because its source crossed 1 MiB.

Additional context

The current limit is MAX_EXTENSION_JS_BYTES = 1024 * 1024 in packages/shared/src/schemas/personal-extension.schema.ts, applied to both js and serverJs in the shared create/update payload schema.

This is separate from the approximately 1 MB private extension-storage quota, the CSS limit, and sandbox protocol limits; those should not be removed accidentally as part of this work. Closed issue #2947 is adjacent historical context about limits, but it does not request this change.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Aug 14, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5025 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? Personal Extensions currently reject Browser JavaScript (`js`) and Server JavaScript (`serverJs`) once either field exceeds 1,048,576 UTF-8 bytes. The same hard cap applies regardless of source, so an extension authored locally by the user—or created as a disabled draft for them—can be rejected even though the user explicitly owns and reviews that code. A fixed 1 MiB source ceiling is too restrictive for bundled or otherwise substantial extensions. It also makes local authoring, import, editing, backup/restore, and re-import behavior unnecessarily fragile. ## Proposed solution Remove the hard-coded 1 MiB validation cap from Personal Extension JavaScript source. - Allow Browser `js` and Server `serverJs` larger than 1 MiB to be created, saved, imported, restored, and re-imported without rejection solely because of this per-field cap. - Apply the behavior consistently across user/Professor Mari drafts, External Extension imports, edits, revisions, and profile restore paths. - Audit import and transport limits so they do not silently recreate the same arbitrary source-size restriction; retain defensible archive, request, and runtime guards with clear errors. - Preserve disabled-by-default behavior, exact-hash approval, capability prompts, privileged/external import gates, and browser/server sandbox boundaries. - Keep independent safety limits for runtime protocol messages and private extension storage where they protect a distinct boundary; this request is specifically about the arbitrary 1 MiB executable-source ceiling. - Add regression coverage for Browser and Server extension source larger than 1 MiB through create, update, import, and restore paths. ## Alternatives considered Raising the cap to another fixed value would only move the same failure point. A configurable cap would still surprise locally authoring users and create inconsistent portability between installations. Boundary-specific transport and decompression guards are preferable to rejecting an otherwise valid extension solely because its source crossed 1 MiB. ## Additional context The current limit is `MAX_EXTENSION_JS_BYTES = 1024 * 1024` in `packages/shared/src/schemas/personal-extension.schema.ts`, applied to both `js` and `serverJs` in the shared create/update payload schema. This is separate from the approximately 1 MB private extension-storage quota, the CSS limit, and sandbox protocol limits; those should not be removed accidentally as part of this work. Closed issue #2947 is adjacent historical context about limits, but it does not request this change. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2778
No description provided.