@shaxpir/duiduidui-models 1.25.6 → 1.25.7

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.
@@ -223,7 +223,15 @@ class Chat extends SharedContent_1.SharedContent {
223
223
  const expiresAt = shaxpir_common_1.Time.plus(now, durationMinutes, 'minutes');
224
224
  const breakpoint = { ttl, created_at: now, expires_at: expiresAt };
225
225
  const batch = new Operation_1.BatchOperation(this);
226
- batch.setPathValue(['payload', 'cache_breakpoints', target], breakpoint);
226
+ // If cache_breakpoints doesn't exist on the payload yet, create the
227
+ // entire object in one operation. OT can't insert into a non-existent
228
+ // parent, so we must create the parent first.
229
+ if (!this.payload.cache_breakpoints) {
230
+ batch.setPathValue(['payload', 'cache_breakpoints'], { [target]: breakpoint });
231
+ }
232
+ else {
233
+ batch.setPathValue(['payload', 'cache_breakpoints', target], breakpoint);
234
+ }
227
235
  batch.commit();
228
236
  }
229
237
  get cacheBreakpoints() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.25.6",
3
+ "version": "1.25.7",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"