aboutsummaryrefslogtreecommitdiffstats
path: root/worker/jmap/cache/gob.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2023-08-18 13:19:49 -0500
committerRobin Jarry <robin@jarry.cc>2023-08-24 14:14:44 +0200
commitf6e3a21db5c307dc3efdf3f30abe2e26246266e9 (patch)
treecad464d12c94187dcf7924610a0cdd302eabda20 /worker/jmap/cache/gob.go
parent4a78ebd85153ebe1d36994cc05db76fe534e54f7 (diff)
downloadaerc-f6e3a21db5c307dc3efdf3f30abe2e26246266e9.tar.gz
jmap: cache session as json
The gob encoder requires registration of types used during encoding. There are several types defined in the Session object that don't directly or indirectly get registered with gob. As a result, the session object never actually gets cached, requiring an authentication step which is often unnecessary. Use json encoding for this object to provide a simpler serialization path. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'worker/jmap/cache/gob.go')
-rw-r--r--worker/jmap/cache/gob.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/worker/jmap/cache/gob.go b/worker/jmap/cache/gob.go
index 589bd954..f1b8be33 100644
--- a/worker/jmap/cache/gob.go
+++ b/worker/jmap/cache/gob.go
@@ -4,14 +4,12 @@ import (
"bytes"
"encoding/gob"
- "git.sr.ht/~rockorager/go-jmap"
"git.sr.ht/~rockorager/go-jmap/mail/email"
"git.sr.ht/~rockorager/go-jmap/mail/mailbox"
)
type jmapObject interface {
- *jmap.Session |
- *email.Email |
+ *email.Email |
*email.QueryResponse |
*mailbox.Mailbox |
*FolderContents |