ofiere-openclaw-plugin 4.2.0 → 4.3.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tools.ts +18 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofiere-openclaw-plugin",
3
- "version": "4.2.0",
3
+ "version": "4.3.0",
4
4
  "type": "module",
5
5
  "description": "OpenClaw plugin for Ofiere PM - 10 meta-tools with 13-action workflow mastery covering tasks, agents, projects, scheduling, knowledge, workflows, notifications, memory, prompts, and constellation agent architecture",
6
6
  "keywords": ["openclaw", "ofiere", "project-management", "agents", "plugin"],
package/src/tools.ts CHANGED
@@ -1334,17 +1334,24 @@ function registerWorkflowOps(
1334
1334
  return { wf: data, error: null };
1335
1335
  }
1336
1336
 
1337
- // Helper: save updated graph back to DB
1337
+ // Helper: save updated graph back to DB with verification re-read
1338
1338
  async function saveGraph(wfId: string, nodes: any[], edges: any[]) {
1339
- const { data, error } = await supabase
1339
+ const { error } = await supabase
1340
1340
  .from("workflows")
1341
1341
  .update({ nodes, edges, updated_at: new Date().toISOString() })
1342
1342
  .eq("id", wfId)
1343
+ .eq("user_id", userId);
1344
+ if (error) return { wf: null, error: error.message };
1345
+ // Verification re-read — guarantees we return the actual persisted state,
1346
+ // not a potentially stale response from the update's connection.
1347
+ const { data: verified, error: readErr } = await supabase
1348
+ .from("workflows")
1349
+ .select("*")
1350
+ .eq("id", wfId)
1343
1351
  .eq("user_id", userId)
1344
- .select()
1345
1352
  .single();
1346
- if (error) return { wf: null, error: error.message };
1347
- return { wf: data, error: null };
1353
+ if (readErr) return { wf: null, error: readErr.message };
1354
+ return { wf: verified, error: null };
1348
1355
  }
1349
1356
 
1350
1357
  switch (action) {
@@ -1358,9 +1365,12 @@ function registerWorkflowOps(
1358
1365
  case "get": {
1359
1366
  const wfId = (params.id || params.workflow_id) as string;
1360
1367
  if (!wfId) return err("Missing required: id");
1361
- const { data, error } = await supabase.from("workflows").select("*").eq("id", wfId).eq("user_id", userId).single();
1362
- if (error) return err(error.message);
1363
- return ok({ workflow: data });
1368
+ // Route through serialization queue so reads wait for pending mutations
1369
+ return sequentialWorkflowOp(wfId, async () => {
1370
+ const { data, error } = await supabase.from("workflows").select("*").eq("id", wfId).eq("user_id", userId).single();
1371
+ if (error) return err(error.message);
1372
+ return ok({ workflow: data });
1373
+ });
1364
1374
  }
1365
1375
  case "create": {
1366
1376
  if (!params.name) return err("Missing required: name");