{"record":{"id":"0ed00ecd830a8929","repo":"chatwoot/chatwoot","slug":"invalid-identifier-for-platform-qr-code","errorCode":null,"errorMessage":"Invalid identifier for ${platform} QR code","messagePattern":"Invalid identifier for (.+?) QR code","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app/javascript/dashboard/routes/dashboard/settings/inbox/FinishSetup.vue","lineNumber":106,"sourceCode":"  }\n\n  if (currentInbox.value.web_widget_script) {\n    return t('INBOX_MGMT.FINISH.WEBSITE_SUCCESS');\n  }\n\n  if (isWhatsAppEmbeddedSignup.value) {\n    return `${t('INBOX_MGMT.FINISH.MESSAGE')}. ${t(\n      'INBOX_MGMT.FINISH.WHATSAPP_QR_INSTRUCTION'\n    )}`;\n  }\n\n  return t('INBOX_MGMT.FINISH.MESSAGE');\n});\n\nasync function generateQRCode(platform, identifier) {\n  if (!identifier || !identifier.trim()) {\n    // eslint-disable-next-line no-console\n    console.warn(`Invalid identifier for ${platform} QR code`);\n    return;\n  }\n\n  try {\n    const platformUrls = {\n      whatsapp: id => `https://wa.me/${id}`,\n      messenger: id => `https://m.me/${id}`,\n      telegram: id => `https://t.me/${id}`,\n    };\n\n    const url = platformUrls[platform](identifier);\n    const qrDataUrl = await QRCode.toDataURL(url);\n    qrCodes[platform] = qrDataUrl;\n  } catch (error) {\n    // eslint-disable-next-line no-console\n    console.error(`Error generating ${platform} QR code:`, error);\n    qrCodes[platform] = '';\n  }","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/chatwoot/chatwoot/blob/ed230f9bc068e7a13dd5c0404d5465a204b68d4c/app/javascript/dashboard/routes/dashboard/settings/inbox/FinishSetup.vue#L88-L124","documentation":"FinishSetup.vue generateQRCode(platform, identifier) warns 'Invalid identifier for <platform> QR code' and returns early when identifier is falsy or only whitespace. The function builds a platform deep-link (wa.me/, m.me/, t.me/) and feeds it to QRCode.toDataURL; without an identifier there is no URL to encode, so the QR image is simply never rendered — no error is thrown to the caller.","triggerScenarios":"The finish-setup step runs for an inbox whose chosen channel has no phone number / PSID / bot username yet: WhatsApp API inbox created before a number is attached, Messenger page not fully linked, Telegram bot username missing. platformUrls[platform](identifier) would otherwise throw, but the guard short-circuits first.","commonSituations":"Inbox creation flow completed partially (embedded signup pending); channel record saved with blank identifier fields; testing the finish-setup screen with fixture inboxes lacking identifiers.","solutions":["Complete the channel configuration first: attach the WhatsApp phone number / Messenger page / Telegram bot username to the inbox, then revisit the finish-setup step.","If you control the flow, disable or hide the QR section until the identifier exists instead of silently skipping it.","Check the console warn to see which platform is missing its identifier."],"exampleFix":"// before\nawait generateQRCode('whatsapp', inbox.phone_number);\n\n// after\nconst id = (inbox.phone_number || '').trim();\nif (id) {\n  await generateQRCode('whatsapp', id);\n} else {\n  // show inline 'add a phone number to get a QR code' hint instead of nothing\n}","handlingStrategy":"validation","validationCode":"// call-site check before asking for a QR code\nconst id = (inbox?.phone_number || inbox?.bot_username || '').trim();\nif (id) {\n  await generateQRCode(platform, id);\n} else {\n  showHint(`${platform} needs a number/username before a QR code can be shown`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await generateQRCode(platform, identifier);\n} catch (error) {\n  // generateQRCode itself no-ops on blank identifiers; this catch covers\n  // QRCode.toDataURL failures (invalid url, canvas issues)\n  console.error(`QR generation failed for ${platform}:`, error);\n}","preventionTips":["Only render the QR section of FinishSetup when the channel's identifier field is non-blank (v-if on the trimmed value).","Enforce identifier presence earlier in inbox creation so the finish step never receives a half-configured channel.","During QA, watch the console warn to identify which platform's inbox fixture is missing its identifier."],"tags":["frontend","vue","qr-code","inbox-setup","validation"],"backgroundTag":"missing-required-parameter","analyzedSha":"ed230f9bc068e7a13dd5c0404d5465a204b68d4c","analyzedAt":"2026-08-21T12:45:25.920Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}