@mastra/mssql 1.0.0-beta.4 → 1.0.0-beta.5

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @mastra/mssql
2
2
 
3
+ ## 1.0.0-beta.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix saveScore not persisting ID correctly, breaking getScoreById retrieval ([#10915](https://github.com/mastra-ai/mastra/pull/10915))
8
+
9
+ **What Changed**
10
+ - saveScore now correctly returns scores that can be retrieved with getScoreById
11
+ - Validation errors now include contextual information (scorer, entity, trace details) for easier debugging
12
+
13
+ **Impact**
14
+ Previously, calling getScoreById after saveScore would return null because the generated ID wasn't persisted to the database. This is now fixed across all store implementations, ensuring consistent behavior and data integrity.
15
+
16
+ - Updated dependencies [[`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b)]:
17
+ - @mastra/core@1.0.0-beta.8
18
+
3
19
  ## 1.0.0-beta.4
4
20
 
5
21
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -2346,13 +2346,21 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
2346
2346
  {
2347
2347
  id: storage.createStorageErrorId("MSSQL", "SAVE_SCORE", "VALIDATION_FAILED"),
2348
2348
  domain: error.ErrorDomain.STORAGE,
2349
- category: error.ErrorCategory.THIRD_PARTY
2349
+ category: error.ErrorCategory.USER,
2350
+ details: {
2351
+ scorer: score.scorer?.id ?? "unknown",
2352
+ entityId: score.entityId ?? "unknown",
2353
+ entityType: score.entityType ?? "unknown",
2354
+ traceId: score.traceId ?? "",
2355
+ spanId: score.spanId ?? ""
2356
+ }
2350
2357
  },
2351
2358
  error$1
2352
2359
  );
2353
2360
  }
2354
2361
  try {
2355
2362
  const scoreId = crypto.randomUUID();
2363
+ const now = /* @__PURE__ */ new Date();
2356
2364
  const {
2357
2365
  scorer,
2358
2366
  preprocessStepResult,
@@ -2379,12 +2387,11 @@ var ScoresMSSQL = class extends storage.ScoresStorage {
2379
2387
  requestContext: requestContext || null,
2380
2388
  entity: entity || null,
2381
2389
  scorer: scorer || null,
2382
- createdAt: (/* @__PURE__ */ new Date()).toISOString(),
2383
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2390
+ createdAt: now.toISOString(),
2391
+ updatedAt: now.toISOString()
2384
2392
  }
2385
2393
  });
2386
- const scoreFromDb = await this.getScoreById({ id: scoreId });
2387
- return { score: scoreFromDb };
2394
+ return { score: { ...validatedScore, id: scoreId, createdAt: now, updatedAt: now } };
2388
2395
  } catch (error$1) {
2389
2396
  throw new error.MastraError(
2390
2397
  {
@@ -3308,8 +3315,8 @@ var MSSQLStore = class extends storage.MastraStorage {
3308
3315
  source: _source
3309
3316
  });
3310
3317
  }
3311
- async saveScore(_score) {
3312
- return this.stores.scores.saveScore(_score);
3318
+ async saveScore(score) {
3319
+ return this.stores.scores.saveScore(score);
3313
3320
  }
3314
3321
  async listScoresByRunId({
3315
3322
  runId: _runId,