Repository navigation
Conversation
`mime_header` found its header by slicing the line at the name's length and comparing that as a string. A header block reaches it through `from_utf8_lossy`, so a line can carry a multibyte character straddling that offset — and the slice panics rather than simply not matching. The length guard above it compares bytes, so it lets such a line through. The panic lands on the account's mail thread, which is where the whole account's IMAP work happens: it dies, every request in flight goes unanswered, and the account's spinner turns for good while the other accounts carry on. The preview repair pass added in 1.27 reaches this code with raw, truncated MIME on every sync, and it re-reads the same rows each time, so once one message qualifies the account never syncs again. Compare as bytes instead. A header name is ASCII, so a byte-wise match also proves the offset is a character boundary, which is what makes the slice on the next line safe. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
hyprlab
added a commit
that referenced
this pull request
Sep 17, 2026
#215) `mime_header` found its header by slicing the line at the name's byte length and comparing that slice as a `str`. A header block reaches it through `String::from_utf8_lossy`, so a line can carry a multibyte character straddling that offset, and the slice panics rather than simply not matching. The length guard above it compares bytes, so it lets such a line through. The panic lands on the account's mail thread, where the whole account's IMAP work happens: it dies, every request in flight goes unanswered, and that account's wheel turns for good while the other accounts carry on. The preview passes reach this code with raw, truncated MIME on every sync and re-read the same rows each time, so once one message qualifies the account never syncs again. Compare as bytes instead. A header name is ASCII, so a byte-wise match also proves the offset is a character boundary, which is what makes the slice on the next line safe. No other behaviour changes, since a line that used to panic is one that could never have matched. Two regression tests reproduce the reported panic when the fix is reverted. Landed from PR #216. Co-Authored-By: Alexander Lubovenko <2742734+typedev@users.noreply.github.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Owner
|
Landed on main as ec7ae6a with your credit and shipped in 1.33.1. Nothing was changed on the way in: the byte-wise comparison, the comment and both tests are as you wrote them. The four tests you could not run in the SDK shell pass on a host with a working pixbuf, so the whole suite is green here. Thank you! |
hyprlab
added a commit
that referenced
this pull request
Sep 17, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
8000
somepaulo
pushed a commit
to somepaulo/hylki
that referenced
this pull request
Sep 24, 2026
hyprlab#215) `mime_header` found its header by slicing the line at the name's byte length and comparing that slice as a `str`. A header block reaches it through `String::from_utf8_lossy`, so a line can carry a multibyte character straddling that offset, and the slice panics rather than simply not matching. The length guard above it compares bytes, so it lets such a line through. The panic lands on the account's mail thread, where the whole account's IMAP work happens: it dies, every request in flight goes unanswered, and that account's wheel turns for good while the other accounts carry on. The preview passes reach this code with raw, truncated MIME on every sync and re-read the same rows each time, so once one message qualifies the account never syncs again. Compare as bytes instead. A header name is ASCII, so a byte-wise match also proves the offset is a character boundary, which is what makes the slice on the next line safe. No other behaviour changes, since a line that used to panic is one that could never have matched. Two regression tests reproduce the reported panic when the fix is reverted. Landed from PR hyprlab#216. Co-Authored-By: Alexander Lubovenko <2742734+typedev@users.noreply.github.com>
somepaulo
pushed a commit
to somepaulo/hylki
that referenced
this pull request
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #215.
mime_headerfound its header by slicing the line at the name's byte length andcomparing that slice as a
str. A header block reaches it throughString::from_utf8_lossy, so a line can carry a multibyte character straddlingthat offset — and the slice panics rather than simply not matching. The length
guard above it compares bytes, so it lets such a line through.
The panic lands on the account's mail thread, which is where the whole account's
IMAP work happens: it dies, every request in flight goes unanswered, and that
account's wheel turns for good while the other accounts carry on. The preview
passes reach this code with raw, truncated MIME on every sync and re-read the
same rows each time, so once one message qualifies the account never syncs
again.
Compare as bytes instead. A header name is ASCII, so a byte-wise match also
proves the offset is a character boundary, which is what makes the slice on the
next line safe — no other behaviour changes, since a line that used to panic is
one that could never have matched.
Tests
Two regression tests in
src/worker.rs:a_header_line_with_a_multibyte_character_is_not_sliced_apart— thecomparison itself, on a header block whose first line puts a two-byte
character across byte 25.
a_preview_survives_a_multibyte_part_header— the same line reached the wayproduction reaches it, as a part of a multipart read for a list preview.
Both reproduce the reported panic message verbatim when the fix is reverted, and
pass with it.
cargo teston this branch: 415 passed, 4 failed. The four aretray::tests::{every_icon_renders_at_every_size, a_half_fill_leaves_a_clear_margin_and_moves_the_dot, the_dot_is_red_and_only_when_asked}and
ui::message_view::tests::a_card_from_your_own_mailbox_wears_that_mailboxs_face.They fail identically on a clean
mainhere and are an artefact of thisenvironment, not of the change: gdk-pixbuf in GNOME runtime 50 decodes through
glycin, which spawns its loader with
flatpak-spawn --sandbox, and that is notavailable in the plain
org.gnome.Sdk//50shell used to run the suite. Their ownpass was not witnessed here.
🤖 Generated with Claude Code