From 711144fde890b7919a1af5d39d5f114cc8938c15 Mon Sep 17 00:00:00 2001 From: Andrew Blakeslee Moore Date: Sun, 5 Jul 2026 22:33:31 -0700 Subject: [PATCH] Session Cache Implementation Nucleic-Session: B2346642-3353-4BD5-9DE2-A8B77BD66C98 Co-authored-by: Nucleic --- NucleicRemote/NucleicRemote/Models/SessionCache.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NucleicRemote/NucleicRemote/Models/SessionCache.swift b/NucleicRemote/NucleicRemote/Models/SessionCache.swift index 21b0b09..2b7b566 100644 --- a/NucleicRemote/NucleicRemote/Models/SessionCache.swift +++ b/NucleicRemote/NucleicRemote/Models/SessionCache.swift @@ -68,7 +68,7 @@ enum SessionCache { guard let root, let url = summariesURL, let dir = transcriptsDir else { return } try? FileManager.default.createDirectory(at: root, withIntermediateDirectories: true) let kept = Array(summaries.sorted { $0.updatedAt > $1.updatedAt }.prefix(sessionLimit)) - if let data = try? encoder.encode(kept) { try? data.write(to: url, options: .atomic) } + if let data = try? JSONEncoder().encode(kept) { try? data.write(to: url, options: .atomic) } // Drop transcript files for sessions that fell out of the recent set. let keep = Set(kept.map(transcriptFileName)) if let files = try? FileManager.default.contentsOfDirectory(