You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Activity
fix(config): cache read no mutation (#1256)