aboutsummaryrefslogtreecommitdiffstats
path: root/worker/jmap/fetch.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2024-06-05 17:49:46 +0200
committerRobin Jarry <robin@jarry.cc>2024-07-02 22:00:06 +0200
commit7a2372773ca870466029cf4137fde71082979a25 (patch)
treed5b9aad77b7bb6274ff37d66dc2c1f2e0fddfa61 /worker/jmap/fetch.go
parent588776f42574567f907c190a5ff089256b21e598 (diff)
downloadaerc-7a2372773ca870466029cf4137fde71082979a25.tar.gz
jmap: do not keep invalid sessions in cache
If a session is found in the cache, check that it works by issuing a GetIdentities request. If that request fails, invalidate the cache and go through the authentication. Ensure that the session is valid and explicitly fail if it is not. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/jmap/fetch.go')
-rw-r--r--worker/jmap/fetch.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/worker/jmap/fetch.go b/worker/jmap/fetch.go
index 17b3fb2f..5d88e6a1 100644
--- a/worker/jmap/fetch.go
+++ b/worker/jmap/fetch.go
@@ -59,7 +59,7 @@ func (w *JMAPWorker) handleFetchMessageHeaders(msg *types.FetchMessageHeaders) e
}
req.Invoke(&email.Get{
- Account: w.accountId,
+ Account: w.AccountId(),
IDs: ids,
Properties: headersProperties,
})
@@ -186,7 +186,7 @@ func (w *JMAPWorker) handleFetchFullMessages(msg *types.FetchFullMessages) error
func (w *JMAPWorker) wrapDownloadError(prefix string, blobId jmap.ID, err error) error {
urlRepl := strings.NewReplacer(
- "{accountId}", string(w.accountId),
+ "{accountId}", string(w.AccountId()),
"{blobId}", string(blobId),
"{type}", "application/octet-stream",
"{name}", "filename",