@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.
- package/dist/encryption/index.cjs.map +1 -1
- package/dist/encryption/index.d.cts +2 -2
- package/dist/encryption/index.d.ts +2 -2
- package/dist/encryption/index.js.map +1 -1
- package/dist/encryption/named-keys.d.cts +1 -1
- package/dist/encryption/named-keys.d.ts +1 -1
- package/dist/index.cjs +97 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +94 -50
- package/dist/index.js.map +1 -1
- package/dist/kv/index.cjs.map +1 -1
- package/dist/kv/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/dist/sql/index.cjs.map +1 -1
- package/dist/sql/index.js.map +1 -1
- package/dist/{types-XE4tyBLH.d.ts → types-Ceti5xVp.d.ts} +39 -4
- package/dist/{types-cWtQmCCw.d.cts → types-CoZ0vXo8.d.cts} +39 -4
- package/package.json +1 -1
|
@@ -258,14 +258,11 @@ function classifyWriteOutcome(op, result, options = {}) {
|
|
|
258
258
|
if (result.ok) return "committed";
|
|
259
259
|
const { code, meta } = result.error;
|
|
260
260
|
if (op === "delete" && code === ErrorCodes.KV_NOT_FOUND) {
|
|
261
|
-
return options.conditional
|
|
261
|
+
return options.conditional ? "failed" : "committed";
|
|
262
262
|
}
|
|
263
|
-
if (meta?.requestMayHaveDispatched === false) return "failed";
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
const status = typeof meta?.status === "number" ? meta.status : void 0;
|
|
267
|
-
if (status !== void 0 && status >= 400 && status < 500) return "failed";
|
|
268
|
-
return "ambiguous";
|
|
263
|
+
if (meta?.requestMayHaveDispatched === false || DEFINITIVE_FAILURES.has(code) || code === ErrorCodes.NODE_BUSY) return "failed";
|
|
264
|
+
const status = meta?.status;
|
|
265
|
+
return meta?.outcome !== "batch-unconfirmed" && typeof status === "number" && status >= 400 && status < 500 ? "failed" : "ambiguous";
|
|
269
266
|
}
|
|
270
267
|
|
|
271
268
|
// src/kv/replication/pendingWrites.ts
|