Skip to content

Commit b10667f

Browse files
committed
fix(microsoft-planner): don't return a stale etag on 204 update_task response
Graph's If-Match update changes the resource's etag even when it returns 204 No Content instead of the updated representation. Returning the request's (now-stale) etag as if it were current would let a chained update silently send a wrong If-Match and fail with 412. Return an empty etag instead so update_task's own etag-required guard forces a re-fetch.
1 parent e65728e commit b10667f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/sim/tools/microsoft_planner/update_task.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,14 @@ export const updateTaskTool: ToolConfig<
217217
return {
218218
success: true,
219219
output: {
220-
message: 'Task updated successfully',
220+
// Graph returned no body, so the etag sent in this request is now stale (the
221+
// update changed it) and the actual new value is unknown. Returning it here would
222+
// let a chained update silently reuse a stale If-Match and fail with 412 — leave
223+
// it empty so callers re-fetch the task before their next update.
224+
message: 'Task updated successfully (re-fetch the task to get its current etag)',
221225
task: {} as PlannerTask,
222226
taskId: params?.taskId?.trim() || '',
223-
etag: params?.etag || '',
227+
etag: '',
224228
metadata: {
225229
taskId: params?.taskId?.trim(),
226230
},

0 commit comments

Comments
 (0)