From eb2f35300b21ad0a4b53028f6b3c30ac616966d2 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Mon, 9 Mar 2026 16:31:37 -0600 Subject: [PATCH] update comment --- client/lib/patch-db.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/client/lib/patch-db.ts b/client/lib/patch-db.ts index 8fda5d8..a35d0e8 100644 --- a/client/lib/patch-db.ts +++ b/client/lib/patch-db.ts @@ -65,11 +65,9 @@ export class PatchDB { start() { if (this.sub) return - // @claude fix #14: Previously used `source$.pipe(withLatestFrom(cache$))`. - // Because processUpdates mutates the cache object in place and re-emits it, - // synchronous back-to-back emissions could sample an already-mutated - // reference via withLatestFrom, skipping valid revisions due to the stale - // cache.id check. Reading `this.cache$.value` directly avoids the issue. + // Simplified from `source$.pipe(withLatestFrom(cache$))`. Both are + // equivalent since cache$ is a BehaviorSubject and processUpdates + // mutates/re-emits synchronously, but `.value` is more direct. this.sub = this.source$.subscribe(updates => { this.processUpdates(updates, this.cache$.value) })