@mastra/convex 1.6.0 → 1.6.1

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.
@@ -3,7 +3,7 @@ name: mastra-convex
3
3
  description: Documentation for @mastra/convex. Use when working with @mastra/convex APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/convex"
6
- version: "1.6.0"
6
+ version: "1.6.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.6.0",
2
+ "version": "1.6.1",
3
3
  "package": "@mastra/convex",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -395,13 +395,19 @@ var ConvexDB = class extends _mastra_core_base.MastraBase {
395
395
  return JSON.parse(context);
396
396
  }
397
397
  async mergeWorkflowState({ workflowName, runId, opts }) {
398
- const snapshot = await this.client.callStorage({
399
- op: "mergeWorkflowState",
400
- tableName: _mastra_core_storage.TABLE_WORKFLOW_SNAPSHOT,
401
- workflowName,
402
- runId,
403
- opts: JSON.stringify(opts)
404
- });
398
+ let snapshot;
399
+ try {
400
+ snapshot = await this.client.callStorage({
401
+ op: "mergeWorkflowState",
402
+ tableName: _mastra_core_storage.TABLE_WORKFLOW_SNAPSHOT,
403
+ workflowName,
404
+ runId,
405
+ opts: JSON.stringify(opts)
406
+ });
407
+ } catch (error) {
408
+ if (error instanceof Error && error.message.startsWith("Workflow snapshot not found for runId")) return;
409
+ throw error;
410
+ }
405
411
  if (snapshot === "") return;
406
412
  if (!snapshot) throw new Error(`Convex workflow state merge returned no snapshot for runId ${runId}`);
407
413
  return JSON.parse(snapshot);