-
-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Conversation
CachedAttachment previously stored only metadata, dropping the decoded payload of inline (cid:) attachments. On a cache hit, attachments were rebuilt with empty Data, so inlineImagesFromAttachments always skipped them and CID lookup resolved against an empty map. Persist the decoded payload for inline attachments on cache write and restore it on read so cid: images render from cache.
@floatpanebot
floatpanebot
added
bug
Something isn't working
area/config
Configuration / settings
size/M
Diff: 51–200 lines
labels
Aug 13, 2026
floatpanebot
commented
Aug 13, 2026
Member
Benchmark report — no significant change
Metrics worse: 0 · better: 0 (threshold: ±3%).
benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 9V74 80-Core Processor
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
ParseSearchQuery_Simple-4 2.559μ ± 28% 2.435μ ± 82% ~ (p=0.818 n=6)
ParseSearchQuery_Complex-4 8.173μ ± 44% 5.982μ ± 39% ~ (p=0.065 n=6)
TokenizeSearchQuery-4 4.170μ ± 19% 3.886μ ± 18% ~ (p=0.900 n=6)
geomean 4.434μ 3.840μ -13.41%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
ParseSearchQuery_Simple-4 26.00 ± 0% 26.00 ± 0% ~ (p=1.000 n=6) 1
ParseSearchQuery_Complex-4 762.0 ± 0% 762.0 ± 0% ~ (p=1.000 n=6) 1
TokenizeSearchQuery-4 176.0 ± 0% 176.0 ± 0% ~ (p=1.000 n=6) 1
geomean 151.6 151.6 +0.00%
1 all samples are equal
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
ParseSearchQuery_Simple-4 2.000 ± 0% 2.000 ± 0% ~ (p=1.000 n=6) 1
ParseSearchQuery_Complex-4 23.00 ± 0% 23.00 ± 0% ~ (p=1.000 n=6) 1
TokenizeSearchQuery-4 9.000 ± 0% 9.000 ± 0% ~ (p=1.000 n=6) 1
geomean 7.453 7.453 +0.00%
1 all samples are equal
pkg: github.com/floatpane/matcha/tui
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
LogPanelView-4 161.0μ ± 16% 158.6μ ± 14% ~ (p=0.394 n=6)
SearchOverlayView-4 187.3μ ± 8% 168.5μ ± 8% -10.05% (p=0.009 n=6)
InboxConstruction-4 895.7μ ± 16% 925.0μ ± 20% ~ (p=0.589 n=6)
geomean 300.0μ 291.3μ -2.91%
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
LogPanelView-4 44.67Ki ± 51% 33.23Ki ± 34% ~ (p=0.675 n=6)
SearchOverlayView-4 33.17Ki ± 69% 56.14Ki ± 41% +69.25% (p=0.028 n=6)
InboxConstruction-4 874.3Ki ± 0% 874.2Ki ± 0% -0.02% (p=0.013 n=6)
geomean 109.0Ki 117.7Ki +7.97%
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
LogPanelView-4 714.0 ± 0% 713.0 ± 0% ~ (p=1.000 n=6)
SearchOverlayView-4 923.5 ± 0% 926.0 ± 0% +0.27% (p=0.041 n=6)
InboxConstruction-4 3.479k ± 0% 3.477k ± 0% -0.06% (p=0.041 n=6)
geomean 1.319k 1.319k +0.02%
auto-generated by benchmarks.yml
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.
What?
Inline
cid:images never render.CachedAttachmentstored only attachment metadata, so the decoded payload of inline attachments was dropped on cache write and never restored on cache read.inlineImagesFromAttachmentsskips attachments with emptyData, so the CID lookup always resolved against an empty map.This PR adds a
Data []bytefield toCachedAttachmentand:PreviewBodyFetchedMsg,EmailBodyFetchedMsg),calculateEmailBodySizeso LRU accounting stays accurate.Why?
Fixes #1702. With the payload cached, the CID lookup in
ProcessBodyWithInlineresolves and inline images render via the Kitty graphics protocol like remote ones.