Repository navigation
Conversation
Gmail shows one message under every label it carries, so the same mail arrives as INBOX + a label + All Mail. `load_attachments` already reads across those copies — `attachments_downloaded_under_one_label_answer_for_the_others` covers it — but `attachments_checked` still keyed strictly on (account, folder, uid). So the prefetch saw each label as unfetched and downloaded the whole message once per label, then stored a second and third copy of blobs it could already answer from. A message under three labels costs three full downloads and three copies on disk for one message's files. Bodies already avoid this: `run_one_body_prefetch` asks `load_body` first, and that reads across labels, so a sibling's body ends the fetch. This gives the attachment path the same reach, through the same `sibling_copies` helper, so both halves of the rule agree. The reach stops where `sibling_copies` stops — a matching Message-ID plus sender and timestamp — so an unrelated message never counts as fetched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
hyprlab
added a commit
that referenced
this pull request
Sep 3, 2026
Gmail shows one message under every label it carries, so the same mail arrives as INBOX + a label + All Mail. `load_attachments` already reads across those copies — `attachments_downloaded_under_one_label_answer_for_the_others` covers it — but `attachments_checked` still keyed strictly on (account, folder, uid). So the prefetch saw each label as unfetched and downloaded the whole message once per label, then stored a second and third copy of blobs it could already answer from. A message under three labels costs three full downloads and three copies on disk for one message's files. Bodies already avoid this: `run_one_body_prefetch` asks `load_body` first, and that reads across labels, so a sibling's body ends the fetch. This gives the attachment path the same reach, through the same `sibling_copies` helper, so both halves of the rule agree. The reach stops where `sibling_copies` stops — a matching Message-ID plus sender and timestamp — so an unrelated message never counts as fetched. Landed from #112. 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
…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 e10f6ee on main, with you as co-author. Thank you. Applied as written. 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
Gmail shows one message under every label it carries, so the same mail arrives as INBOX + a label + All Mail. `load_attachments` already reads across those copies — `attachments_downloaded_under_one_label_answer_for_the_others` covers it — but `attachments_checked` still keyed strictly on (account, folder, uid). So the prefetch saw each label as unfetched and downloaded the whole message once per label, then stored a second and third copy of blobs it could already answer from. A message under three labels costs three full downloads and three copies on disk for one message's files. Bodies already avoid this: `run_one_body_prefetch` asks `load_body` first, and that reads across labels, so a sibling's body ends the fetch. This gives the attachment path the same reach, through the same `sibling_copies` helper, so both halves of the rule agree. The reach stops where `sibling_copies` stops — a matching Message-ID plus sender and timestamp — so an unrelated message never counts as fetched. Landed from hyprlab#112. 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
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
Ad
32C6
d 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 #111.
Gmail shows one message under every label it carries, so the same mail arrives as INBOX + a label + All Mail.
load_attachmentsalready reads across those copies —attachments_downloaded_under_one_label_answer_for_the_otherscovers it — butattachments_checkedstill keyed strictly on (account, folder, uid), andqueue_attachment_prefetchasks that one.So each label looked unfetched: the whole message was downloaded again, and
save_attachmentswrote another full copy of the blobs under that folder. A message under three labels costs three downloads and three copies on disk for one message's files. The reader never shows them, because the read side already reaches across.The change
The body query moves to a private
checked_of, unchanged. No new helper and no new SQL — this is the samesibling_copiesthe body and attachment read paths already use.Symmetry with bodies
run_one_body_prefetchasksload_bodybefore it connects, andload_bodyreads across labels, so a sibling's cached body ends the fetch before any network work. The attachment path was the same shape with that step missing. After this change both halves agree.Tests
attachments_fetched_under_one_label_count_as_fetched_for_the_others— one message under two labels, marked fetched under one, reads as fetched under the other.another_message_being_fetched_does_not_count_as_this_one— a different message under a label does not count, becausesibling_copiesrequires Message-ID, sender and timestamp to match.Full suite: 249 passed, 0 failed.
Note
This stops new duplicates. Copies already written by an earlier build stay until something clears them — a one-time sweep on upgrade would reclaim that space, happy to add it here or separately, whichever you prefer.