{"record":{"id":"e11dd59af31761c8","repo":"paperclipai/paperclip","slug":"teams-file-card-send-result-is-unknown","errorCode":null,"errorMessage":"Teams file-card send result is unknown","messagePattern":"Teams file-card send result is unknown","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/chat-sdk-runtime.ts","lineNumber":1264,"sourceCode":"          \"Teams file cards require an exact personal conversation\",\n        );\n      }\n      return await withThreadServiceUrl(\n        threadId,\n        async () => {\n          let result: unknown;\n          try {\n            // Direct App attachment send is deliberately inside the same route\n            // ALS as ordinary thread operations. Thread.post would turn these\n            // provider-native cards into AdaptiveCards.\n            result = await teams.app!.send!(decoded.conversationId as string, {\n              type: \"message\",\n              attachments: [card],\n            });\n          } catch {\n            // Provider errors may contain private card contexts. No implicit\n            // retry: an uncertain POST remains caller-owned durable evidence.\n            throw new Error(\"Teams file-card send result is unknown\");\n          }\n          if (\n            !isRecord(result) ||\n            typeof result.id !== \"string\" ||\n            !result.id ||\n            result.id.length > 1024 ||\n            /[\\x00-\\x20\\x7f]/.test(result.id)\n          ) {\n            throw new Error(\"Teams file-card send receipt is unproven\");\n          }\n          return { id: result.id };\n        },\n        true,\n      );\n    };\n  }\n\n  teams.paperclipRecordThreadServiceUrl = async (","sourceCodeStart":1246,"sourceCodeEnd":1282,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/services/chat-sdk-runtime.ts#L1246-L1282","documentation":"When sending a Teams file card via teams.app.send, the code wraps the POST in try/catch and, on any provider error, replaces the original error with this generic one. The original provider error is intentionally swallowed because it may contain private card context; an uncertain POST is treated as caller-owned durable evidence with no implicit retry.","triggerScenarios":"teams.app.send(conversationId, {type:'message', attachments:[card]}) rejects: network failure, expired/invalid serviceUrl, Teams API rejecting the card payload, rate limiting, or any thrown exception inside the send call.","commonSituations":"Stale conversation serviceUrl after routing change; Teams tenant blocking the bot; malformed file-consent card payload rejected by the Bot Framework; transient 5xx/timeout from the Teams connector.","solutions":["Inspect server logs for the original provider error around this call site (the code suppresses it deliberately).","Verify the recorded serviceUrl for the conversation is still valid; re-record it via teams.paperclipRecordThreadServiceUrl.","Check the card payload (parseTeamsFileConsentCard / parseTeamsUploadedFileCard output) against Bot Framework file-card schema.","Retry the send manually once connectivity/provider health is confirmed — the runtime will not retry implicitly by design."],"exampleFix":"// before\nawait teams.paperclipSendFileCard(threadId, \"consent\", cardInput); // throws generic 'unknown'\n// after\ntry {\n  await teams.paperclipSendFileCard(threadId, \"consent\", cardInput);\n} catch (err) {\n  logger.warn({ threadId, err }, \"teams file-card send uncertain; check provider logs\");\n  throw err;\n}","handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  await teams.paperclipSendFileCard(threadId, kind, input);\n} catch (err) {\n  // Send result unknown: do NOT auto-retry (risk of duplicate cards).\n  logger.error({ threadId, kind }, \"teams file-card send uncertain; verify delivery before retry\");\n  throw err;\n}","preventionTips":["Keep the recorded Teams serviceUrl fresh (re-record after adapter restarts).","Validate card payloads with the parser functions before sending.","Monitor Teams connector health; back off during provider incidents.","Never blind-retry this send: an uncertain POST may have delivered the card."],"tags":["teams","send-failure","provider-error"],"backgroundTag":"http-request-failed","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}