Skip to content

fix(cache): Add log email cache errors#1181

Merged
LeaWhoCodes merged 2 commits intofloatpane:masterfrom
joserafaelSH:fix/1030
Apr 28, 2026
Merged

fix(cache): Add log email cache errors#1181
LeaWhoCodes merged 2 commits intofloatpane:masterfrom
joserafaelSH:fix/1030

Conversation

@joserafaelSH
Copy link
Copy Markdown
Contributor

What?

Added error handling and logging to email body caching operations in main.go. Previously, config.SaveEmailBody() calls were ignoring errors with _, now they capture and log failures for both synchronous and asynchronous caching scenarios.

Code changes:

// Before (synchronous):
_ = config.SaveEmailBody(folderForCache, config.CachedEmailBody{...})

// After (synchronous):
err := config.SaveEmailBody(folderForCache, config.CachedEmailBody{...})
if err != nil {
    log.Printf("debug: error caching email body fails (disk full, permission denied) for UID: %d: %v", msg.UID, err)
}

// Before (asynchronous):
go config.SaveEmailBody(folderName, config.CachedEmailBody{...})

// After (asynchronous):
go func() {
    err := config.SaveEmailBody(folderName, config.CachedEmailBody{...})
    if err != nil {
        log.Printf("debug: error caching email body fails (disk full, permission denied) for UID: %d: %v", msg.UID, err)
    }
}()

Why?

Email body caching could fail silently due to disk full or permission denied errors, making debugging difficult when users experienced missing cached emails. This change adds visibility into caching failures to help diagnose storage-related issues.

closes: #1030

@joserafaelSH joserafaelSH requested a review from a team as a code owner April 28, 2026 02:27
@github-actions github-actions Bot added bug Something isn't working question Further information requested labels Apr 28, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @joserafaelSH! Please fix the following issues with your PR:

  • Title: Is too long (62 characters). The PR title must be strictly under 40 characters.

@joserafaelSH joserafaelSH changed the title fix(cache): Add Error Handling for Email Body Caching Failures fix(cache): Add error logging for email cache Apr 28, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @joserafaelSH! Please fix the following issues with your PR:

  • Title: Is too long (45 characters). The PR title must be strictly under 40 characters.

@joserafaelSH joserafaelSH changed the title fix(cache): Add error logging for email cache fix(cache): Add log email cache errors Apr 28, 2026
@floatpanebot floatpanebot dismissed stale reviews from themself April 28, 2026 02:31

Formatting issues have been resolved. Thank you!

@andrinoff andrinoff removed the question Further information requested label Apr 28, 2026
@andrinoff
Copy link
Copy Markdown
Member

Great! Thank you for your contribution!

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@andrinoff
Copy link
Copy Markdown
Member

/approve

Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Approved on behalf of @andrinoff via /approve command.

@LeaWhoCodes LeaWhoCodes merged commit 0cba695 into floatpane:master Apr 28, 2026
18 of 20 checks passed
@joserafaelSH joserafaelSH deleted the fix/1030 branch April 28, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: SaveEmailBody error ignored after fetching message body

4 participants