Skip to content

Commit 75e3673

Browse files
logs for onboard debugging
1 parent 0433f50 commit 75e3673

File tree

4 files changed

+44
-0
lines changed

4 files changed

+44
-0
lines changed

src/tasks/cwv-demo-suggestions-processor/handler.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,15 @@ export async function runCwvDemoSuggestionsProcessor(message, context) {
297297
profile,
298298
});
299299

300+
// Debug: Check if slackContext is present
301+
log.info('cwv-demo-suggestions-processor slackContext check:', {
302+
hasSlackContext: !!slackContext,
303+
hasChannelId: !!slackContext?.channelId,
304+
hasThreadTs: !!slackContext?.threadTs,
305+
channelId: slackContext?.channelId,
306+
threadTs: slackContext?.threadTs,
307+
});
308+
300309
try {
301310
if (!profile || profile !== DEMO) {
302311
return {

src/tasks/demo-url-processor/handler.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ export async function runDemoUrlProcessor(message, context) {
7575
organizationId,
7676
});
7777

78+
// Debug: Check if slackContext is present
79+
log.info('demo-url-processor slackContext check:', {
80+
hasSlackContext: !!slackContext,
81+
hasChannelId: !!slackContext?.channelId,
82+
hasThreadTs: !!slackContext?.threadTs,
83+
channelId: slackContext?.channelId,
84+
threadTs: slackContext?.threadTs,
85+
});
86+
7887
let imsTenantId = context.env.DEFAULT_TENANT_ID;
7988
try {
8089
const organization = await Organization.findById(organizationId);
@@ -94,7 +103,15 @@ export async function runDemoUrlProcessor(message, context) {
94103
const slackMessage = `:white_check_mark: Onboarding setup completed successfully for the site ${siteUrl}!\nAccess your environment here: ${demoUrl}`;
95104

96105
if (slackContext) {
106+
log.info('Attempting to send Slack message:', {
107+
channelId: slackContext.channelId,
108+
threadTs: slackContext.threadTs,
109+
messageLength: slackMessage.length,
110+
});
97111
await say(env, log, slackContext, slackMessage);
112+
log.info('Slack message sent successfully');
113+
} else {
114+
log.warn('Skipping Slack notification: slackContext is not defined');
98115
}
99116

100117
log.info(`Onboarding setup completed successfully for the site ${siteUrl}! Access your environment here: ${demoUrl}`);

src/tasks/disable-import-audit-processor/handler.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ export async function runDisableImportAuditProcessor(message, context) {
3939
scheduledRun,
4040
});
4141

42+
// Debug: Check if slackContext is present
43+
log.info('disable-import-audit-processor slackContext check:', {
44+
hasSlackContext: !!slackContext,
45+
hasChannelId: !!slackContext?.channelId,
46+
hasThreadTs: !!slackContext?.threadTs,
47+
channelId: slackContext?.channelId,
48+
threadTs: slackContext?.threadTs,
49+
});
50+
4251
if (scheduledRun) {
4352
log.info(`Scheduled run detected - skipping disable of imports and audits for site: ${siteUrl}`);
4453
await say(env, log, slackContext, `:information_source: Scheduled run detected for site ${siteUrl} - skipping disable of imports and audits`);

src/tasks/opportunity-status-processor/handler.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,15 @@ export async function runOpportunityStatusProcessor(message, context) {
424424
onboardStartTime: onboardStartTime ? new Date(onboardStartTime).toISOString() : undefined,
425425
});
426426

427+
// Debug: Check if slackContext is present
428+
log.info('opportunity-status-processor slackContext check:', {
429+
hasSlackContext: !!slackContext,
430+
hasChannelId: !!slackContext?.channelId,
431+
hasThreadTs: !!slackContext?.threadTs,
432+
channelId: slackContext?.channelId,
433+
threadTs: slackContext?.threadTs,
434+
});
435+
427436
try {
428437
// Get the site and its opportunities
429438
const site = await Site.findById(siteId);

0 commit comments

Comments
 (0)