From 70ea752992d2d716fdf42eece81da8b24bf8532b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:12:28 +0000 Subject: [PATCH] Remove redundant docCache update (onChange already handles it) Co-authored-by: naielv <109038805+naielv@users.noreply.github.com> --- src/db.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/db.js b/src/db.js index dadc6be..f986102 100644 --- a/src/db.js +++ b/src/db.js @@ -135,11 +135,9 @@ var DB = (function () { await local.put(doc); // FIX: manually trigger map() callbacks for local update - // Call onChange BEFORE updating docCache so that onChange can detect the change + // onChange will update docCache and notify all subscribers onChange({ doc: doc }); - try { docCache[_id] = typeof doc.data === 'string' ? doc.data : JSON.stringify(doc.data); } catch (e) {} - } catch (e) { console.error('DB.put error', e); }