{"record":{"id":"305fa7972809b63b","repo":"mastra-ai/mastra","slug":"app-creation-returned-incomplete-data","errorCode":null,"errorMessage":"App creation returned incomplete data","messagePattern":"App creation returned incomplete data","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"channels/slack/src/client.ts","lineNumber":152,"sourceCode":"        signing_secret: string;\n      };\n      oauth_authorize_url?: string;\n    };\n\n    if (!data.ok) {\n      // Slack may include detailed error info\n      let errorDetails = data.error ?? 'unknown_error';\n      if (data.errors?.length) {\n        errorDetails += ': ' + data.errors.map(e => `${e.pointer}: ${e.message}`).join(', ');\n      }\n      if (data.response_metadata?.messages?.length) {\n        errorDetails += ' - ' + data.response_metadata.messages.join(', ');\n      }\n      throw new Error(`App creation failed: ${errorDetails}`);\n    }\n\n    if (!data.app_id || !data.credentials || !data.oauth_authorize_url) {\n      throw new Error('App creation returned incomplete data');\n    }\n\n    return {\n      appId: data.app_id,\n      clientId: data.credentials.client_id,\n      clientSecret: data.credentials.client_secret,\n      signingSecret: data.credentials.signing_secret,\n      oauthAuthorizeUrl: data.oauth_authorize_url,\n    };\n  }\n\n  /**\n   * Delete a Slack app.\n   */\n  async deleteApp(appId: string): Promise<void> {\n    await this.rotateToken();\n\n    const response = await fetch(`${SLACK_API_BASE}/apps.manifest.delete`, {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/channels/slack/src/client.ts#L134-L170","documentation":"If Slack responds ok:true to app creation but omits app_id, credentials, or oauth_authorize_url, the returned object would be incomplete and unusable for completing OAuth installation, so the client throws before returning.","triggerScenarios":"createApp() receives { ok: true } with a body missing app_id, credentials (client_id/client_secret), or oauth_authorize_url.","commonSituations":"Slack API response-shape changes; partial responses from an unstable API; middleware/proxies truncating response bodies.","solutions":["Log the raw createApp response to identify the missing field, then retry","Update the package to the latest version in case the Slack API contract changed","Check for proxies/interceptors that could strip fields from the JSON response"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const app = await client.createApp(manifest);\n} catch (e) {\n  if ((e as Error).message === 'App creation returned incomplete data') {\n    // transient/contract issue — retry once, then inspect raw response via logging\n  } else throw e;\n}","preventionTips":["Retry app creation on this error — it usually indicates a partial response","Keep the Slack channel package updated for API contract changes","Remove proxies/interceptors that could truncate JSON responses"],"tags":["slack","api-contract","response-shape"],"backgroundTag":"api-response-contract-mismatch","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}