{"record":{"id":"f81958c01662fec0","repo":"overleaf/overleaf","slug":"error-flushing-tranferred-projects-to-tpds","errorCode":null,"errorMessage":"error flushing tranferred projects to TPDS","messagePattern":"error flushing tranferred projects to TPDS","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"services/web/app/src/Features/Collaborators/CollaboratorsHandler.mjs","lineNumber":268,"sourceCode":"    }\n  ).exec()\n\n  await Project.updateMany(\n    { pendingReviewer_refs: fromUserId },\n    {\n      $addToSet: { pendingReviewer_refs: toUserId },\n    }\n  ).exec()\n  await Project.updateMany(\n    { pendingReviewer_refs: fromUserId },\n    {\n      $pull: { pendingReviewer_refs: fromUserId },\n    }\n  ).exec()\n\n  // Flush in background, no need to block on this\n  _flushProjects(projectIds).catch(err => {\n    logger.err(\n      { err, projectIds, fromUserId, toUserId },\n      'error flushing tranferred projects to TPDS'\n    )\n  })\n}\n\nasync function setCollaboratorPrivilegeLevel(\n  projectId,\n  userId,\n  privilegeLevel,\n  { pendingEditor, pendingReviewer } = {},\n  auditInfo = {}\n) {\n  AsyncLocalStorage.removeItem(`projectAccess:${projectId}`)\n  // Make sure we're only updating the project if the user is already a\n  // collaborator\n  const query = {\n    _id: projectId,","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/overleaf/overleaf/blob/28ad3b03b71cb4311decdcb55c36b33ec10d72db/services/web/app/src/Features/Collaborators/CollaboratorsHandler.mjs#L250-L286","documentation":"Background error in CollaboratorsHandler.transferProjects: after ownership was transferred in mongo, the fire-and-forget _flushProjects call failed to flush the affected projects to TPDS (third-party dropbox integration). The transfer itself already succeeded — only the deferred TPDS sync for those projectIds failed, risking stale TPDS state until the next sync.","triggerScenarios":"Thrown at services/web/app/src/Features/Collaborators/CollaboratorsHandler.mjs:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trigger a manual TPDS flush/resync for the logged projectIds","Check TPDS worker health and the underlying err for the flush failure","Retry project transfer flushes with backoff from a queue instead of fire-and-forget","Verify TPDS state for affected projects after recovery"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"28ad3b03b71cb4311decdcb55c36b33ec10d72db","analyzedAt":"2026-09-03T02:10:22.807Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}