Skip to content

[MT-23016] Resolve inline CID images safely in HTML previews#41

Merged
kyrylo-yevdokymov merged 3 commits into
mainfrom
fix/mt-23016-inline-cid-images
Jul 14, 2026
Merged

[MT-23016] Resolve inline CID images safely in HTML previews#41
kyrylo-yevdokymov merged 3 commits into
mainfrom
fix/mt-23016-inline-cid-images

Conversation

@kyrylo-yevdokymov

@kyrylo-yevdokymov kyrylo-yevdokymov commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

What & why

Fixes MT-23016, a sub-task of MT-22849.

Browsers cannot resolve MIME cid: references directly. The preview now maps known content IDs in HTML URL attributes and CSS url() values to the existing attachment-part endpoint. Matching is intentionally limited to URL contexts so visible message text is never rewritten.

Impact

Inline images render in the HTML preview and popout while HTML Source remains unchanged.

Screenshots

Before After

Verification

  • npm test — 67 tests passed
  • npm run lint — 0 errors; 4 existing warnings
  • npm run build — passed
  • git diff --check main...fix/mt-23016-inline-cid-images — passed

Kyrylo Yevdokymov and others added 2 commits July 13, 2026 13:24
Emails embed inline images as MIME parts referenced via cid: URLs
(RFC 2392), which browsers cannot resolve, so the HTML tab's preview
iframe rendered them as broken icons. The backend already serves part
bytes by part_id with the original Content-Type, and the message JSON
carries content_id for inline parts + attachments — nothing rewrote
the references.

Rewrite cid:<content-id> refs to origin-absolute part URLs before
handing the HTML to MessagePreview (absolute so they also resolve in
the blob:-based "open in new tab" popout). The HTML Source tab keeps
the original markup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@kyrylo-yevdokymov, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 42 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 753e2f93-2f80-41f2-96e7-e49f20ffcb1c

📥 Commits

Reviewing files that changed from the base of the PR and between 4c8f262 and 55a3d14.

📒 Files selected for processing (4)
  • frontend/src/lib/inlineImages.test.ts
  • frontend/src/lib/inlineImages.ts
  • frontend/src/pages/MessageView.test.tsx
  • frontend/src/pages/MessageView.tsx

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.

@kyrylo-yevdokymov

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kyrylo-yevdokymov
kyrylo-yevdokymov marked this pull request as ready for review July 13, 2026 10:43

@roman-adamchik roman-adamchik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@kyrylo-yevdokymov
kyrylo-yevdokymov merged commit f2f74b5 into main Jul 14, 2026
5 checks passed
@kyrylo-yevdokymov
kyrylo-yevdokymov deleted the fix/mt-23016-inline-cid-images branch July 14, 2026 15:42
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.

4 participants