Remove redundant docCache update (onChange already handles it)

Co-authored-by: naielv <109038805+naielv@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-21 12:12:28 +00:00
parent 492889b9e1
commit 70ea752992

View File

@@ -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);
}