From 5c71e4ce58b9d53bdbceb3d980d58d4a8430ab0c Mon Sep 17 00:00:00 2001 From: Mo Tarbin Date: Sun, 16 Aug 2026 01:07:55 -0400 Subject: [PATCH] fix: handle manual bug reports by modifying error structure in submitErrorReport --- src/service/ErrorReportService.js | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/service/ErrorReportService.js b/src/service/ErrorReportService.js index 1d9689c..07c44c9 100644 --- a/src/service/ErrorReportService.js +++ b/src/service/ErrorReportService.js @@ -249,13 +249,28 @@ export const submitErrorReport = async ({ description, report, }) => { + // The relay rejects reports without an error. Manual bug reports have no + // thrown Error, so mark only the submitted copy while preserving the local + // diagnostics as a manual report. + const submittedReport = + report.kind === 'bug' + ? { + ...report, + error: { + ...report.error, + name: 'ManualBugReport', + message: 'Submitted manually from the app', + }, + } + : report + const payload = { source: 'donetick-app', - kind: report.kind === 'bug' ? 'bug-report' : 'error-report', + kind: 'error-report', reportId: report.reportId, description: description?.trim() || null, contactEmail: contactEmail?.trim() || null, - report, + report: submittedReport, } // Enforced here, not only in the UI, so no future caller can relay a