@usearete/sdk 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -2083,7 +2083,13 @@ class FrameProcessor {
2083
2083
  if (normalized === null) {
2084
2084
  break;
2085
2085
  }
2086
- const nextValue = this.attachInternalSeq(viewPath, normalized, frame.seq ?? this.extractSeq(frame.data));
2086
+ const nextValue = this.attachInternalSeq(viewPath, normalized,
2087
+ // Fall back to the previous entity's sequence, as the patch branch
2088
+ // below does. Without this an unsequenced upsert drops the tracked
2089
+ // sequence (it rides on the object being replaced), disarming the
2090
+ // staleness guard until the next sequenced frame and letting a
2091
+ // later older frame overwrite newer data.
2092
+ frame.seq ?? this.extractSeq(frame.data) ?? this.getInternalSeq(previousValue));
2087
2093
  this.storage.set(viewPath, frame.key, nextValue);
2088
2094
  const update = {
2089
2095
  type: 'upsert',