@mastra/mssql 1.7.2 → 1.7.3-alpha.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/CHANGELOG.md +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts +3 -1
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mastra/mssql
|
|
2
2
|
|
|
3
|
+
## 1.7.3-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Enforce atomic conditional background task state updates so cancellation cannot be overwritten during dispatch. Background task storage is no longer exposed by Cloudflare KV or ClickHouse, which cannot provide the required compare-and-set semantics. ([#22228](https://github.com/mastra-ai/mastra/pull/22228))
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`aa3a85d`](https://github.com/mastra-ai/mastra/commit/aa3a85daf094c683bb97efdf4b6a696d2e474af5), [`d29d06f`](https://github.com/mastra-ai/mastra/commit/d29d06fe00bbd35b4571150ea04c59d2ed783c71), [`e6516df`](https://github.com/mastra-ai/mastra/commit/e6516dfcdae4f4ac0e7971d84359a81385ee602f), [`0b2a3d1`](https://github.com/mastra-ai/mastra/commit/0b2a3d1783875c5b97b7b36ab3d03d7360e0dde7), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`57de7d6`](https://github.com/mastra-ai/mastra/commit/57de7d644ba7146edb4e9e6111ec4fa98c3a59e9), [`e8e299c`](https://github.com/mastra-ai/mastra/commit/e8e299cc6abdfc39947e2fec25803493015d3882), [`edfc548`](https://github.com/mastra-ai/mastra/commit/edfc548886bc7bae17b681f8b6b41a47eb32bcd2), [`a8a4871`](https://github.com/mastra-ai/mastra/commit/a8a4871215f51da95c47129602157ce5372f634a), [`5165cdc`](https://github.com/mastra-ai/mastra/commit/5165cdcdcf50e144bb8113278535196cc9b07065), [`6bb5d71`](https://github.com/mastra-ai/mastra/commit/6bb5d7193fe9166b219f0fccae17db7a5ae86e65), [`9ee8120`](https://github.com/mastra-ai/mastra/commit/9ee8120ce17f76b9f617489e05a283353742690a), [`d975e92`](https://github.com/mastra-ai/mastra/commit/d975e924d4936f46c386bd3dee39c671720289f6), [`1cfa878`](https://github.com/mastra-ai/mastra/commit/1cfa8784d8da0dfaa0317e5048bc48b6084a5ea5), [`c118318`](https://github.com/mastra-ai/mastra/commit/c1183181c9804303db4b511c2e2648f8b714712b), [`fc07c64`](https://github.com/mastra-ai/mastra/commit/fc07c6465043e08e99193a6751a01c56ffc2e7a1), [`542dee2`](https://github.com/mastra-ai/mastra/commit/542dee254167f974ff8cbbbfc0ce10f9a2616a7b), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`a58483c`](https://github.com/mastra-ai/mastra/commit/a58483cff1a9d41fce7c931843f48cb0ac450f64), [`895e9df`](https://github.com/mastra-ai/mastra/commit/895e9dfc17d6f34299eca64e317ded9e5f5e5ef8)]:
|
|
10
|
+
- @mastra/core@1.62.0-alpha.8
|
|
11
|
+
|
|
3
12
|
## 1.7.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -1914,7 +1914,7 @@ var BackgroundTasksMSSQL = class BackgroundTasksMSSQL extends _mastra_core_stora
|
|
|
1914
1914
|
}
|
|
1915
1915
|
});
|
|
1916
1916
|
}
|
|
1917
|
-
async updateTask(taskId, update) {
|
|
1917
|
+
async updateTask(taskId, update, options) {
|
|
1918
1918
|
const setClauses = [];
|
|
1919
1919
|
const params = {};
|
|
1920
1920
|
let idx = 1;
|
|
@@ -1950,12 +1950,18 @@ var BackgroundTasksMSSQL = class BackgroundTasksMSSQL extends _mastra_core_stora
|
|
|
1950
1950
|
setClauses.push(`[completedAt] = @p${idx}`);
|
|
1951
1951
|
params[`p${idx++}`] = update.completedAt?.toISOString() ?? null;
|
|
1952
1952
|
}
|
|
1953
|
-
if (setClauses.length === 0) return;
|
|
1953
|
+
if (setClauses.length === 0) return false;
|
|
1954
1954
|
setClauses.push(`[id] = [id]`);
|
|
1955
1955
|
params[`p${idx}`] = taskId;
|
|
1956
|
+
const taskIdParam = `p${idx++}`;
|
|
1957
|
+
let statusPredicate = "";
|
|
1958
|
+
if (options?.expectedStatus) {
|
|
1959
|
+
params[`p${idx}`] = options.expectedStatus;
|
|
1960
|
+
statusPredicate = ` AND [status] = @p${idx}`;
|
|
1961
|
+
}
|
|
1956
1962
|
const request = this.pool.request();
|
|
1957
1963
|
for (const [name, value] of Object.entries(params)) request.input(name, value);
|
|
1958
|
-
await request.query(`UPDATE ${this.tableName()} SET ${setClauses.join(", ")} WHERE [id] =
|
|
1964
|
+
return ((await request.query(`UPDATE ${this.tableName()} SET ${setClauses.join(", ")} WHERE [id] = @${taskIdParam}${statusPredicate}`)).rowsAffected[0] ?? 0) > 0;
|
|
1959
1965
|
}
|
|
1960
1966
|
async getTask(taskId) {
|
|
1961
1967
|
const request = this.pool.request();
|