read function should not modify cache state
As discussed in #1227, there is a request to update LastAccessedAt inside GetCachedEmailBody.
This is not necessary and violates separation of concerns. GetCachedEmailBody() is a read operation and should not modify cache state. SaveEmailBody() is responsible for inserting or updating email bodies.
In main.go, GetCachedEmailBody() is called twice during email viewing. The first call is in UpdatePreviewMsg, which returns PreviewBodyFetchedMsg and then calls SaveEmailBody(). The second call is in ViewEmailMsg, which returns EmailBodyFetchedMsg and also calls SaveEmailBody().
Therefore, the following two lines should be removed from GetCachedEmailBody in config/cache.go:
cache.Bodies[i].LastAccessedAt = time.Now()
_ = saveEmailBodyCache(cache)
This issue should be labeled as good first issue.