Skip to content

Migrated functions using heic2any to heic-convert; Update CSP - #8100

Open
mrafie1 wants to merge 5 commits into
MarkUsProject:masterfrom
mrafie1:remove-csp-heic-exception
Open

Migrated functions using heic2any to heic-convert; Update CSP#8100
mrafie1 wants to merge 5 commits into
MarkUsProject:masterfrom
mrafie1:remove-csp-heic-exception

Conversation

@mrafie1

@mrafie1 mrafie1 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

In this PR, I updated functions that use heic2any to use heic-convert.

  • Installed heic-convert and uninstalled heic2any (no other functions/code required heic2any) in package.jsonfiles
  • Migrated image_viewer.jsx to use heic-convert
  • Updated CSP of results_controller and submissions_controller to not have an exception for unsafe_eval, since MarkUs uses heic-convert instead of heic2any
  • Updated content_security_policy.rb information regarding heic2any and usages of unsafe_eval because of this package
Screenshots of your changes (if applicable)

In this video:

  • I upload a heic image
  • I am able to view this heic image
  • I inspect this image and see that it has been successfully turned into a "blob" link.
Screen.Recording.2026-07-31.at.20.33.40.mov

Type of Change

(Write an X or a brief description next to the type or types that best describe your changes.)

Type Applies?
🚨 Breaking change (fix or feature that would cause existing functionality to change)
New feature (non-breaking change that adds functionality)
🐛 Bug fix (non-breaking change that fixes an issue)
🎨 User interface change (change to user interface; provide screenshots)
♻️ Refactoring (internal change to codebase, without changing functionality) x
🚦 Test update (change that only adds or modifies tests)
📦 Dependency update (change that updates a dependency) x
📖 Documentation update (change that updates documentation)
🔧 Internal (change that only affects developers or continuous integration)

Checklist

(Complete each of the following items for your pull request. Indicate that you have completed an item by changing the [ ] into a [x] in the raw text, or by clicking on the checkbox in the rendered description on GitHub.)

Before opening your pull request:

  • I have performed a self-review of my changes.
    • Check that all changed files included in this pull request are intentional changes.
    • Check that all changes are relevant to the purpose of this pull request, as described above.
  • I have added tests for my changes, if applicable.
    • This is required for all bug fixes and new features.
  • I have updated the project documentation, if applicable.
    • This is required for new features.
  • If this is my first contribution, I have added myself to the list of contributors.

After opening your pull request:

  • I have updated the project Changelog (this is required for all changes).
  • I have verified that the pre-commit.ci checks have passed.
  • I have verified that the CI tests have passed.
  • I have reviewed the test coverage changes reported by Coveralls.
  • I have requested a review from a project maintainer.

Questions and Comments

(Include any questions or comments you have regarding your changes.)

@coveralls

coveralls commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 30707107693

Coverage decreased (-0.005%) to 90.498%

Details

  • Coverage decreased (-0.005%) from the base build.
  • Patch coverage: 6 uncovered changes across 1 file (2 of 8 lines covered, 25.0%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
app/javascript/Components/Result/image_viewer.jsx 6 0 0.0%
Total (3 files) 8 2 25.0%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
app/javascript/Components/Result/image_viewer.jsx 1 0.0%

Coverage Stats

Coverage Status
Relevant Lines: 51606
Covered Lines: 47731
Line Coverage: 92.49%
Relevant Branches: 2486
Covered Branches: 1221
Branch Coverage: 49.12%
Branches in Coverage %: Yes
Coverage Strength: 129.09 hits per line

💛 - Coveralls

@mrafie1
mrafie1 requested a review from david-yz-liu August 1, 2026 16:11
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.

2 participants