Repository navigation
Conversation
`extract_attachments` dropped any part carrying a Content-ID and weighing under 64 KiB, to keep a newsletter's `cid:` logo out of the file list. It never looked at Content-Disposition, so a part the sender explicitly marked `attachment` was thrown away on size alone. Gmail's composer stamps a Content-ID (`<f_…>`) on every file it uploads, whatever its type or size, so this hits ordinary mail: a message carrying two small PDFs alongside one large file lists only the large one. Anything sent from web Gmail under 64 KiB — invoices, statements, spreadsheets, screenshots — goes the same way, and nothing in the reader hints that a file is missing. The paperclip stays on, which makes it worse to diagnose: the flag comes from `structure_has_attachment`, which tests disposition before falling back to size, and was right all along. The two halves of one rule disagreed. Exempt a declared attachment and they agree again. Decoration is untouched: a `cid:` logo arrives as `disposition: inline`, so the size test still hides it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
typedev
force-pushed
the
fix/gmail-inline-cid-attachments
branch
from
September 2, 2026 17:46
866ad86 to
11da5cc
Compare
hyprlab
added a commit
that referenced
this pull request
Sep 3, 2026
`extract_attachments` dropped any part carrying a Content-ID and weighing under 64 KiB, to keep a newsletter's `cid:` logo out of the file list. It never looked at Content-Disposition, so a part the sender explicitly marked `attachment` was thrown away on size alone. Gmail's composer stamps a Content-ID (`<f_…>`) on every file it uploads, whatever its type or size, so this hits ordinary mail: a message carrying two small PDFs alongside one large file lists only the large one. Anything sent from web Gmail under 64 KiB — invoices, statements, spreadsheets, screenshots — goes the same way, and nothing in the reader hints that a file is missing. The paperclip stays on, which makes it worse to diagnose: the flag comes from `structure_has_attachment`, which tests disposition before falling back to size, and was right all along. The two halves of one rule disagreed. Exempt a declared attachment and they agree again. Decoration is untouched: a `cid:` logo arrives as `disposition: inline`, so the size test still hides it. Landed from #110. Co-Authored-By: Alexander Lubovenko <2742734+typedev@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ay7c8wSGyaTPNuDXShNgAw
hyprlab
added a commit
that referenced
this pull request
Sep 3, 2026
The two previous commits stop new damage; this heals what earlier builds already wrote. Mail synced before them has attachment lists that are wrong in place — small declared files missing (#109), blobs stored once per Gmail label (#111) — and `attachments_checked` remembers those messages as done, so `queue_attachment_prefetch` would never touch them again and the wrong lists would survive forever. Bump the cache schema to v13 and drop `attachments` and `attachments_checked` on upgrade. The re-fetch is bounded: the prefetch re-touches only the newest 25 flagged messages per folder, and everything else heals lazily when a message is opened, since `LoadAttachments` fetches on demand. Dropping the blobs also reclaims the per-label duplicate copies in one stroke. Suggested in #110 and #112. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ay7c8wSGyaTPNuDXShNgAw
hyprlab
added a commit
that referenced
this pull request
Sep 3, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ay7c8wSGyaTPNuDXShNgAw
hyprlab
added a commit
that referenced
this pull request
Sep 3, 2026
RFC 2047 §6.2 joins adjacent encoded-words separated only by linear whitespace and discards the separator: it is there so a long word can be folded, not as part of the text. `mail_parser` decodes both words but keeps the whitespace inside parameter values, so a file announced as two spliced encoded-words arrives named `docu ment.pdf` — no `.pdf` suffix, so no thumbnail and nothing to open it with. A header folded between the words leaves a tab instead of a space, same result. Once decoding has happened the boundary is gone, and a space in a filename is often genuine — so the repair splices the raw header bytes (`?=` whitespace `=?` is pure ASCII, safe to scan) and hands the fixed Content-Disposition and Content-Type back to mail_parser, keeping every charset decision in one place. The second parse only runs when a splice changed something. Landed from #118, resolving a test-module conflict with #110's landing. The contributor intends to report the underlying behaviour to mail_parser upstream; this workaround can come out if that lands. Co-Authored-By: Alexander Lubovenko <2742734+typedev@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ay7c8wSGyaTPNuDXShNgAw
hyprlab
added a commit
that referenced
this pull request
Sep 3, 2026
…andles Feature beta previewing 1.20.0. See CHANGELOG.md for the full list: composer spell checking with bundled dictionaries and a managed personal word list (discussion #114), inline images in the composer (discussion #113), replies that follow Reply-To, the split reply and attachment drawer resized by a floating grab pill, paste-as-plain-text by default, the wide-mail scroll fix, and the three attachment fixes from #110, #112 and #118 with a one-time cache repair. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ay7c8wSGyaTPNuDXShNgAw
Owner
|
Landed in stable 1.20.0 as commit b1988c1 on main, with you as co-author. Thank you. Your change went in as written; the only addition alongside it is a one-time attachment cache rebuild on upgrade (schema v13), so mail synced by earlier versions heals too. Closing since the commit is on main rather than merged from the branch. |
hyprlab
added a commit
that referenced
this pull request
Sep 24, 2026
…andles Feature beta previewing 1.20.0. See CHANGELOG.md for the full list: composer spell checking with bundled dictionaries and a managed personal word list (discussion #114), inline images in the composer (discussion #113), replies that follow Reply-To, the split reply and attachment drawer resized by a floating grab pill, paste-as-plain-text by default, the wide-mail scroll fix, and the three attachment fixes from #110, #112 and #118 with a one-time cache repair.
somepaulo
pushed a commit
to somepaulo/hylki
that referenced
this pull request
Sep 24, 2026
`extract_attachments` dropped any part carrying a Content-ID and weighing under 64 KiB, to keep a newsletter's `cid:` logo out of the file list. It never looked at Content-Disposition, so a part the sender explicitly marked `attachment` was thrown away on size alone. Gmail's composer stamps a Content-ID (`<f_…>`) on every file it uploads, whatever its type or size, so this hits ordinary mail: a message carrying two small PDFs alongside one large file lists only the large one. Anything sent from web Gmail under 64 KiB — invoices, statements, spreadsheets, screenshots — goes the same way, and nothing in the reader hints that a file is missing. The paperclip stays on, which makes it worse to diagnose: the flag comes from `structure_has_attachment`, which tests disposition before falling back to size, and was right all along. The two halves of one rule disagreed. Exempt a declared attachment and they agree again. Decoration is untouched: a `cid:` logo arrives as `disposition: inline`, so the size test still hides it. Landed from hyprlab#110. 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
The two previous commits stop new damage; this heals what earlier builds already wrote. Mail synced before them has attachment lists that are wrong in place — small declared files missing (hyprlab#109), blobs stored once per Gmail label (hyprlab#111) — and `attachments_checked` remembers those messages as done, so `queue_attachment_prefetch` would never touch them again and the wrong lists would survive forever. Bump the cache schema to v13 and drop `attachments` and `attachments_checked` on upgrade. The re-fetch is bounded: the prefetch re-touches only the newest 25 flagged messages per folder, and everything else heals lazily when a message is opened, since `LoadAttachments` fetches on demand. Dropping the blobs also reclaims the per-label duplicate copies in one stroke. Suggested in hyprlab#110 and hyprlab#112.
somepaulo
pushed a commit
to somepaulo/hylki
that referenced
this pull request
Sep 24, 2026
somepaulo
pushed a commit
to somepaulo/hylki
that referenced
this pull request
Sep 24, 2026
RFC 2047 §6.2 joins adjacent encoded-words separated only by linear whitespace and discards the separator: it is there so a long word can be folded, not as part of the text. `mail_parser` decodes both words but keeps the whitespace inside parameter values, so a file announced as two spliced encoded-words arrives named `docu ment.pdf` — no `.pdf` suffix, so no thumbnail and nothing to open it with. A header folded between the words leaves a tab instead of a space, same result. Once decoding has happened the boundary is gone, and a space in a filename is often genuine — so the repair splices the raw header bytes (`?=` whitespace `=?` is pure ASCII, safe to scan) and hands the fixed Content-Disposition and Content-Type back to mail_parser, keeping every charset decision in one place. The second parse only runs when a splice changed something. Landed from hyprlab#118, resolving a test-module conflict with hyprlab#110's landing. The contributor intends to report the underlying behaviour to mail_parser upstream; this workaround can come out if that lands. Co-Authored-By: Alexander Lubovenko <2742734+typedev@users.noreply.github.com>
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 #109.
extract_attachmentsdropped any part carrying a Content-ID and weighing under 64 KiB, to keep a newsletter'scid:logo out of the file list. It never looked at Content-Disposition, so a part the sender explicitly markedattachmentwas thrown away on size alone.Gmail's composer stamps a Content-ID (
<f_…>) on every file it uploads, whatever its type or size, so this hits ordinary mail: a message carrying two small PDFs alongside one large file lists only the large one. Anything sent from web Gmail under 64 KiB — invoices, statements, spreadsheets, screenshots — goes the same way, and nothing in the reader hints that a file is missing.The paperclip stays on, which makes it worse to diagnose: the flag comes from
structure_has_attachment, which tests disposition before falling back to size, and was right all along. The two halves of one rule disagreed. Exempting a declared attachment makes them agree again.The change
Deliberately minimal: the size heuristic keeps working for everything that did not declare itself an attachment.
Decoration still hidden
A
cid:logo or a signature image arrives asContent-Disposition: inline, notattachment, so the size test still hides it. The existing tests covering that path are unchanged and still pass:cid_resources_are_not_listed_as_attachmentssmall_cid_image_is_still_only_decorationlarge_cid_image_is_listed_as_an_attachmentTest
Adds
small_declared_attachments_survive_their_content_id: amultipart/mixedin the shape Gmail's composer produces — every part declaredattachmentand stamped with an<f_…>Content-ID — with two files below the threshold and one above. Before the change it returns one attachment; after, all three.Full suite: 248 passed, 0 failed.
Note on already-synced mail
attachments_checkedremembers messages whose attachments were fetched, including ones that "turned out to have none", so mail already synced by an affected build will not be re-fetched and will keep showing an incomplete list. Clearing that table on upgrade would repair existing mailboxes — happy to add it here or in a follow-up, whichever you prefer.