{"record":{"id":"0e98ab7c88630018","repo":"jackwener/OpenCLI","slug":"pin-update-did-not-return-the-updated-pin","errorCode":null,"errorMessage":"Pin update did not return the updated pin","messagePattern":"Pin update did not return the updated pin","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/pinterest/pin-update.js","lineNumber":64,"sourceCode":"    if (boardRef) {\n      const { username, slug, path, board: preloadedBoard } = await resolveBoardTarget(page, boardRef);\n      await page.goto(`${PINTEREST_BASE}${path}`);\n      const { boardId } = await resolveBoardId(page, username, slug, path, preloadedBoard);\n      options.board_id = boardId;\n      // PinResource/update is the only endpoint that honours a section, and only under this key.\n      if (section) options.board_section_id = (await resolveSection(page, boardId, section, path)).sectionId;\n      sourceUrl = path;\n    } else {\n      await page.goto(`${PINTEREST_BASE}${sourceUrl}`);\n    }\n\n    if (title) options.title = title;\n    if (description !== undefined) options.description = description;\n    if (link !== undefined) options.link = link;\n\n    const updated = await pinterestResourceUpdate(page, 'PinResource', options, sourceUrl);\n    if (!updated || !updated.id) {\n      throw new CommandExecutionError('Pin update did not return the updated pin');\n    }\n\n    return [{\n      pinId: String(updated.id),\n      title: (updated.title || updated.grid_title || title || '').trim(),\n      board: (updated.board && updated.board.name) || boardRef,\n      url: `${PINTEREST_BASE}/pin/${updated.id}/`,\n    }];\n  },\n});\n","sourceCodeStart":46,"sourceCodeEnd":75,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/pinterest/pin-update.js#L46-L75","documentation":"Thrown in clis/pinterest/pin-update.js:64 when pinterestResourceUpdate on PinResource returns nothing usable (no object or no id). The library treats this as an unsuccessful update since it cannot confirm the change or report the pin's new state.","triggerScenarios":"The PinResource/update call completes but yields an empty/malformed payload — expired session cookies, Pinterest silently rejecting the edit (permissions, moderation), wrong pin/board state, or a Pinterest API/DOM change breaking response extraction.","commonSituations":"Editing a pin on a board you no longer have write access to; session expiry mid-automation; Pinterest A/B API changes; rate limiting returning empty bodies; passing a --board reference that resolved incorrectly so the update path errors server-side.","solutions":["Re-authenticate / refresh session cookies, then retry — empty resource responses usually mean an unauthenticated request","Verify you still have write access to the pin's board in the browser","Retry later if Pinterest is rate-limiting; test a trivial edit (title tweak) in the browser to confirm updates work at all","If it persists, capture the PinResource/update network response and update the library's parsing of the reply"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const probe = await run(['pin', pinId]);\nif (!probe) throw new Error('Pin not accessible; aborting update');","typeGuard":"function hasPinId(res) {\n  return res !== null && typeof res === 'object' && res.id !== undefined;\n}","tryCatchPattern":"try {\n  await run(['pin-update', pinId, ...fieldArgs]);\n} catch (e) {\n  if (/did not return the updated pin/.test(e.message)) {\n    await refreshSession();\n    return retry(() => run(['pin-update', pinId, ...fieldArgs]), 1);\n  }\n  throw e;\n}","preventionTips":["Keep sessions fresh; empty update responses usually mean expired cookies","Verify write access to the pin's board before scripted edits","Space out bulk edits to avoid rate-limited empty responses","After updates, read the pin back to confirm the change stuck"],"tags":["network","pinterest","api-response","session"],"backgroundTag":"empty-api-response","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}