Skip to content

fix: add missing Office macro-enabled MIME types to file allowlist#9047

Open
algojogacor wants to merge 1 commit into
makeplane:previewfrom
algojogacor:fix/add-office-macro-mime-types
Open

fix: add missing Office macro-enabled MIME types to file allowlist#9047
algojogacor wants to merge 1 commit into
makeplane:previewfrom
algojogacor:fix/add-office-macro-mime-types

Conversation

@algojogacor
Copy link
Copy Markdown

@algojogacor algojogacor commented May 11, 2026

Description

Add missing MIME type support for Microsoft Office macro-enabled and binary file formats. These file types (.xlsb, .xlsm, .xltm, .xlam, .pptm, .ppsm, .potm, .ppam, .docm, .dotm) were not included in the attachment MIME type allowlists, preventing users from uploading these common Office file formats.

Updated both:

  • Backend: apps/api/plane/settings/common.pyATTACHMENT_MIME_TYPES list
  • Frontend: packages/editor/src/core/constants/config.tsACCEPTED_ATTACHMENT_MIME_TYPES array

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media

N/A — this is a data-only change adding new string entries to existing arrays.

Test Scenarios

  • Verified that all 10 new MIME types are correctly formatted according to IANA standards
  • Existing MIME types in the list are unchanged

References

Fixes #9038

Summary by CodeRabbit

  • New Features
    • Expanded attachment file format support to include additional Microsoft Office macro-enabled and binary formats for Excel, PowerPoint, and Word documents. Users can now upload template variants, macro-enabled versions, and add-in formats, providing significantly broader compatibility with Microsoft Office file types.

Review Change Stack

Add support for Microsoft Office macro-enabled and binary formats:
- Excel: .xlsb, .xlsm, .xltm, .xlam
- PowerPoint: .pptm, .ppsm, .potm, .ppam
- Word: .docm, .dotm

Fixes makeplane#9038
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

📝 Walkthrough

Walkthrough

This pull request extends MIME type support for Microsoft Office macro-enabled and binary file formats across the backend API and frontend editor. The changes add 11 new MIME type strings to parallel allowlists in both apps/api/plane/settings/common.py and packages/editor/src/core/constants/config.ts to enable users to upload Excel .xlsb/.xlsm, Word macro-enabled, and PowerPoint macro-enabled files.

Changes

Microsoft Office MIME Type Support

Layer / File(s) Summary
Backend Settings
apps/api/plane/settings/common.py
ATTACHMENT_MIME_TYPES allowlist appends Microsoft Office macro-enabled MIME types for Excel, Word, and PowerPoint formats.
Frontend Constants
packages/editor/src/core/constants/config.ts
ACCEPTED_ATTACHMENT_MIME_TYPES constant appends the same Microsoft Office macro-enabled and binary format MIME type strings.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🐰 Macro-enabled files hop into the fold,
Excel, Word, and PowerPoint uploads bold,
MIME types expanded, no logic to hold,
Configuration blessed, a feature controlled. ✨📎

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding missing Office macro-enabled MIME types to file allowlists, which directly matches the PR's primary objective.
Description check ✅ Passed The description comprehensively addresses all template sections with specific details about changes, type of change (bug fix), file locations, test verification, and issue reference #9038.
Linked Issues check ✅ Passed The PR successfully implements all key requirements from issue #9038: adds missing MIME types for Excel (.xlsb, .xlsm, .xltm, .xlam), PowerPoint (.pptm, .ppsm, .potm, .ppam), and Word (.docm, .dotm) macro-enabled formats in both backend and frontend, using IANA-compliant MIME type strings.
Out of Scope Changes check ✅ Passed All changes are directly scoped to addressing the linked issue: only MIME type additions to two configuration files without unrelated modifications or refactoring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/editor/src/core/constants/config.ts (1)

19-80: ⚡ Quick win

Use satisfies to avoid widening this MIME allowlist.

Please define this constant with literal preservation + structural validation so accidental non-literal drift is caught earlier.

Suggested refactor
-export const ACCEPTED_ATTACHMENT_MIME_TYPES = [
+export const ACCEPTED_ATTACHMENT_MIME_TYPES = [
   "image/jpeg",
   "image/png",
   "image/gif",
   "image/svg+xml",
   "image/webp",
   "image/tiff",
   "image/bmp",
   "application/pdf",
   "application/msword",
   "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
   "application/vnd.ms-excel",
   "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
   "application/vnd.ms-powerpoint",
   "application/vnd.openxmlformats-officedocument.presentationml.presentation",
   // Microsoft Office macro-enabled and binary formats
   "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
   "application/vnd.ms-excel.sheet.macroEnabled.12",
   "application/vnd.ms-excel.template.macroEnabled.12",
   "application/vnd.ms-excel.addin.macroEnabled.12",
   "application/vnd.ms-powerpoint.presentation.macroEnabled.12",
   "application/vnd.ms-powerpoint.slideshow.macroEnabled.12",
   "application/vnd.ms-powerpoint.template.macroEnabled.12",
   "application/vnd.ms-powerpoint.addin.macroEnabled.12",
   "application/vnd.ms-word.document.macroEnabled.12",
   "application/vnd.ms-word.template.macroEnabled.12",
   "text/plain",
   "text/markdown",
   "application/rtf",
   "audio/mpeg",
   "audio/wav",
   "audio/ogg",
   "audio/midi",
   "audio/x-midi",
   "audio/aac",
   "audio/flac",
   "audio/x-m4a",
   "video/mp4",
   "video/mpeg",
   "video/ogg",
   "video/webm",
   "video/quicktime",
   "video/x-msvideo",
   "video/x-ms-wmv",
   "application/zip",
   "application/x-rar-compressed",
   "application/x-tar",
   "application/gzip",
   "model/gltf-binary",
   "model/gltf+json",
   "application/octet-stream",
   "font/ttf",
   "font/otf",
   "font/woff",
   "font/woff2",
   "text/css",
   "text/javascript",
   "application/json",
   "text/xml",
   "text/csv",
   "application/xml",
-];
+] as const satisfies readonly string[];

As per coding guidelines: "Use the satisfies operator to validate types without widening them".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/editor/src/core/constants/config.ts` around lines 19 - 80, The
ACCEPTED_ATTACHMENT_MIME_TYPES array should preserve literal types and be
structurally validated; change its declaration to use "as const" together with
the TypeScript "satisfies" operator (e.g., declare
ACCEPTED_ATTACHMENT_MIME_TYPES with as const and satisfy readonly string[] or a
more specific readonly string[] type) so elements remain literal types while
still validating the shape, ensuring accidental widening is caught at compile
time.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/editor/src/core/constants/config.ts`:
- Around line 19-80: The ACCEPTED_ATTACHMENT_MIME_TYPES array should preserve
literal types and be structurally validated; change its declaration to use "as
const" together with the TypeScript "satisfies" operator (e.g., declare
ACCEPTED_ATTACHMENT_MIME_TYPES with as const and satisfy readonly string[] or a
more specific readonly string[] type) so elements remain literal types while
still validating the shape, ensuring accidental widening is caught at compile
time.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2b8df194-c300-45f3-acbb-3d41177ddf59

📥 Commits

Reviewing files that changed from the base of the PR and between 4c1bdd1 and 7f44ffb.

📒 Files selected for processing (2)
  • apps/api/plane/settings/common.py
  • packages/editor/src/core/constants/config.ts

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Missing MIME type support for Microsoft Office macro-enabled and binary files

2 participants