@tinycloud/sdk-services 3.12.0-beta.4 → 3.12.0-beta.8

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.
@@ -290,14 +290,11 @@ function classifyWriteOutcome(op, result, options = {}) {
290
290
  if (result.ok) return "committed";
291
291
  const { code, meta } = result.error;
292
292
  if (op === "delete" && code === ErrorCodes.KV_NOT_FOUND) {
293
- return options.conditional === true ? "failed" : "committed";
294
- }
295
- if (meta?.requestMayHaveDispatched === false) return "failed";
296
- if (DEFINITIVE_FAILURES.has(code)) return "failed";
297
- if (meta?.outcome === "batch-unconfirmed") return "ambiguous";
298
- const status = typeof meta?.status === "number" ? meta.status : void 0;
299
- if (status !== void 0 && status >= 400 && status < 500) return "failed";
300
- return "ambiguous";
293
+ return options.conditional ? "failed" : "committed";
294
+ }
295
+ if (meta?.requestMayHaveDispatched === false || DEFINITIVE_FAILURES.has(code) || code === ErrorCodes.NODE_BUSY) return "failed";
296
+ const status = meta?.status;
297
+ return meta?.outcome !== "batch-unconfirmed" && typeof status === "number" && status >= 400 && status < 500 ? "failed" : "ambiguous";
301
298
  }
302
299
 
303
300
  // src/kv/replication/pendingWrites.ts