@tinycloud/sdk-services 3.12.0-beta.3 → 3.12.0-beta.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.
- package/dist/index.cjs +10 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/kv/replication/index.cjs +5 -8
- package/dist/kv/replication/index.cjs.map +1 -1
- package/dist/kv/replication/index.js +4 -7
- package/dist/kv/replication/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
294
|
-
}
|
|
295
|
-
if (meta?.requestMayHaveDispatched === false) return "failed";
|
|
296
|
-
|
|
297
|
-
|
|
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
|