Skip to content

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Sep 29, 2025

Closes #1755

If the file name ends with .jar but the mime type is an archive (e.g. a zip) change the mime type to application/jar.

@Boy132 Boy132 self-assigned this Sep 29, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 29, 2025

Warning

Rate limit exceeded

@Boy132 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 53e3645 and e6dce61.

📒 Files selected for processing (1)
  • app/Models/File.php (1 hunks)
📝 Walkthrough

Walkthrough

Adjusted mime_type resolution in app/Models/File.php getRows: when a file name ends with .jar and the detected MIME is in ARCHIVE_MIMES, the mime_type is set to application/jar; otherwise, the original MIME is used. No public API changes; overall row structure and error handling unchanged.

Changes

Cohort / File(s) Summary
MIME resolution for .jar files
app/Models/File.php
Modified getRows mapping to override MIME: if filename ends with .jar and original MIME is in ARCHIVE_MIMES, set mime_type to application/jar; else keep original MIME. No other structural changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as Panel UI
  participant Backend as Backend (File::getRows)
  participant FS as Filesystem

  User->>UI: Open file manager
  UI->>Backend: Request file list
  Backend->>FS: Read directory entries
  FS-->>Backend: File metadata (name, size, mime, ...)
  rect rgb(230,240,255)
    note over Backend: MIME resolution (changed)
    Backend->>Backend: For each file: if name endsWith ".jar" AND mime ∈ ARCHIVE_MIMES<br/>then mime = "application/jar"<br/>else keep original mime
  end
  Backend-->>UI: Rows with resolved mime_type
  UI-->>User: Render file list (icons based on mime_type)
Loading

Pre-merge checks

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Fix mime type for jar files” directly and concisely describes the core change of the pull request, namely adjusting how .jar files’ MIME types are determined, and it avoids unnecessary detail or vague wording.
Linked Issues Check ✅ Passed The implementation adds conditional logic to map files ending in .jar with archive MIME types to application/jar, fulfilling the primary objective of normalized icon display for .jar files across all origins as specified in issue #1755.
Out of Scope Changes Check ✅ Passed All modifications are confined to the MIME type resolution logic in app/Models/File.php and directly relate to the goals of the linked issue, with no unrelated or extraneous code alterations present.
Description Check ✅ Passed The description clearly states that the PR closes issue #1755 and explains that .jar files detected as archive types will be remapped to application/jar, which matches the actual code changes in getRows.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

@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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec5fd32 and 53e3645.

📒 Files selected for processing (1)
  • app/Models/File.php (1 hunks)

@rmartinoscar
Copy link
Member

Shouldn't this be handled on wings ?

@Boy132
Copy link
Member Author

Boy132 commented Sep 29, 2025

Shouldn't this be handled on wings ?

No. This is purely a frontend QoL change.

@Boy132 Boy132 merged commit df75dbe into main Oct 1, 2025
25 checks passed
@Boy132 Boy132 deleted the boy132/fix-jar-mime branch October 1, 2025 08:30
@github-actions github-actions bot locked and limited conversation to collaborators Oct 1, 2025
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.

File icons are different by their origin

4 participants