{"record":{"id":"f54d407b401cbaf1","repo":"iOfficeAI/AionUi","slug":"failed-to-flush-feedback-report-eventid-ev","errorCode":null,"errorMessage":"Failed to flush feedback report${eventId ? ` (${eventId})` : ''}: Sentry is not initialized","messagePattern":"Failed to flush feedback report(.+?)\\)` : ''\\}: Sentry is not initialized","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/desktop/src/renderer/services/feedback/submitFeedbackReport.ts","lineNumber":306,"sourceCode":"      });\n\n      eventId = Sentry.captureEvent(\n        {\n          level: 'info',\n          message: eventSummary,\n          extra: {\n            description: normalizedDescription,\n            ...input.extra,\n          },\n        },\n        { attachments }\n      );\n    });\n\n    if (input.flushTimeoutMs !== undefined) {\n      const client = Sentry.getClient();\n      if (!client) {\n        throw new Error(`Failed to flush feedback report${eventId ? ` (${eventId})` : ''}: Sentry is not initialized`);\n      }\n\n      const flushed = await client.flush(input.flushTimeoutMs);\n      if (!flushed) {\n        throw new Error(`Failed to flush feedback report${eventId ? ` (${eventId})` : ''}`);\n      }\n    }\n\n    logFeedbackReport('info', 'submitted', {\n      module: input.module,\n      eventId,\n      collectLogs: Boolean(input.collectLogs),\n      logAttachment: summarizeLogAttachment(logAttachmentStatus, logAttachment),\n      dbDiagnosticsAttachment: summarizeDbDiagnosticsAttachment(dbDiagnosticsAttachmentStatus, dbDiagnosticsAttachment),\n      attachmentCount: attachments.length,\n      attachments: summarizeAttachments(attachments),\n      flushTimeoutMs: input.flushTimeoutMs,\n      tagKeys: Object.keys(input.tags ?? {}),","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/iOfficeAI/AionUi/blob/711aa0550ee183ea495dc33e2c05c7943b70a60a/packages/desktop/src/renderer/services/feedback/submitFeedbackReport.ts#L288-L324","documentation":"After submitting a feedback report with a `flushTimeoutMs`, the code calls `Sentry.getClient().flush(...)`; if no Sentry client exists (SDK never initialized in this renderer), it throws this error because the report events were queued to a non-existent transport and will never be delivered.","triggerScenarios":"Calling `submitFeedbackReport` with `flushTimeoutMs` defined while `Sentry.init` was never executed (or was skipped due to config/DSN absence or an early-init failure) in the current process.","commonSituations":"Sentry disabled in dev builds or via config flag but the flush path still requested; init raced or crashed (e.g. invalid DSN); code refactoring moved Sentry init after first feedback submission; telemetry opt-out leaving the client absent.","solutions":["Ensure `Sentry.init` runs (with a valid DSN) before any submitFeedbackReport call that sets flushTimeoutMs","If telemetry can be disabled, skip the flush block when `Sentry.getClient()` is null instead of throwing","Check init ordering in app bootstrap and that the DSN/config loaded correctly","For opted-out users, resolve submission gracefully (log-and-continue) rather than failing the report flow"],"exampleFix":"// before\nconst client = Sentry.getClient();\nif (!client) {\n  throw new Error(`Failed to flush feedback report…: Sentry is not initialized`);\n}\nconst flushed = await client.flush(input.flushTimeoutMs);\n\n// after\nconst client = Sentry.getClient();\nif (!client) {\n  logFeedbackReport('warn', 'sentry-unavailable', {});\n  return { eventId, flushed: false } as const;\n}","handlingStrategy":"type-guard","validationCode":"if (input.flushTimeoutMs !== undefined && !Sentry.getClient()) { /* skip flush, log */ }","typeGuard":"const isSentryReady = (): boolean => Sentry.getClient() !== undefined;","tryCatchPattern":"catch (e) { if (e.message.includes('Sentry is not initialized')) { log.warn('telemetry unavailable'); return; } throw e; }","preventionTips":["Initialize Sentry at app bootstrap before feedback flows","Treat telemetry absence as non-fatal"],"tags":["sentry","telemetry","feedback","initialization"],"backgroundTag":"sentry-not-initialized","analyzedSha":"711aa0550ee183ea495dc33e2c05c7943b70a60a","analyzedAt":"2026-08-28T07:56:06.558Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}