Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

refactor: add diagnostics to slack integration error

Brad Barbin8dd70fe5f3ef
diff --git a/packages/integrations/src/slack/lib/service.ts b/packages/integrations/src/slack/lib/service.ts
index 1ff8630471..d7388c366f 100644
--- a/packages/integrations/src/slack/lib/service.ts
+++ b/packages/integrations/src/slack/lib/service.ts
@@ -297,18 +297,30 @@ export async function getCarbonEmployeeFromSlackId(
carbonCompanyId: string
) {
try {
+ console.log({
+ function: "getCarbonEmployeeFromSlackId",
+ accessToken,
+ slackUserId,
+ carbonCompanyId,
+ });
const slackClient = createSlackWebClient({ token: accessToken });
const userInfo = await slackClient.users.info({
user: slackUserId,
});
+ console.log({
+ userInfo,
+ });
+
if (!userInfo.ok || !userInfo.user?.profile?.email) {
return { data: null, error: "Could not retrieve user email from Slack" };
}
const email = userInfo.user.profile.email;
+ console.log({ email });
+
const user = await client
.from("user")
.select("id")