matcha icon indicating copy to clipboard operation
matcha copied to clipboard

BUG: Race condition in folderEmails map access without synchronization

Open andrinoff opened this issue 7 months ago • 2 comments

Describe the bug

In markEmailAsReadInStores() (main.go:738-745), the code iterates over and modifies m.folderEmails map without any synchronization. This map is also accessed from goroutines in saveFolderEmailsToCache() (line 630) and fetchFolderEmailsCmd() (line 2426+), creating a data race.

To reproduce

  1. Rapidly switch folders while emails are being fetched
  2. Run with -race flag to detect

Expected behavior

Access to m.folderEmails should be protected by a mutex.

andrinoff avatar Apr 24 '26 20:04 andrinoff

This has had no activity for 30 days. It will be closed in 14 days unless updated. Comment or remove the stale label to keep it open.

floatpanebot avatar May 26 '26 06:05 floatpanebot

Closing due to inactivity. Reopen if still relevant.

floatpanebot avatar Jun 09 '26 06:06 floatpanebot