From e50db1367e7522f2c47edcbfeed1ee364dae05dc Mon Sep 17 00:00:00 2001 From: Doug <6060466+pixlwave@users.noreply.github.com> Date: Thu, 3 Jul 2025 12:09:27 +0100 Subject: [PATCH] Add a few more labels when sending a rageshake. (#4284) --- .../BugReportScreenViewModel.swift | 21 +++++++++---------- .../Services/BugReport/BugReportService.swift | 17 ++++++++++----- Enterprise | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModel.swift b/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModel.swift index a6d102d1d..c27a88ac4 100644 --- a/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModel.swift +++ b/ElementX/Sources/Screens/BugReportScreen/BugReportScreenViewModel.swift @@ -97,17 +97,16 @@ class BugReportScreenViewModel: BugReportScreenViewModelType, BugReportScreenVie // Continue anyway without the screenshot. } } - let ed25519 = await clientProxy?.ed25519Base64() - let curve25519 = await clientProxy?.curve25519Base64() - let bugReport = BugReport(userID: clientProxy?.userID, - deviceID: clientProxy?.deviceID, - ed25519: ed25519, - curve25519: curve25519, - text: context.reportText, - logFiles: context.sendingLogsEnabled ? logFiles : nil, - canContact: context.canContact, - githubLabels: [], - files: files) + + let bugReport = await BugReport(userID: clientProxy?.userID, + deviceID: clientProxy?.deviceID, + ed25519: clientProxy?.ed25519Base64(), + curve25519: clientProxy?.curve25519Base64(), + text: context.reportText, + logFiles: context.sendingLogsEnabled ? logFiles : nil, + canContact: context.canContact, + githubLabels: [], + files: files) switch await bugReportService.submitBugReport(bugReport, progressListener: progressSubject) { diff --git a/ElementX/Sources/Services/BugReport/BugReportService.swift b/ElementX/Sources/Services/BugReport/BugReportService.swift index 649f1e0f1..83d333159 100644 --- a/ElementX/Sources/Services/BugReport/BugReportService.swift +++ b/ElementX/Sources/Services/BugReport/BugReportService.swift @@ -68,7 +68,7 @@ class BugReportService: NSObject, BugReportServiceProtocol { fatalError("No bug report URL set, the screen should not be shown in this case.") } - let bugReport = appHooks.bugReportHook.update(bugReport) + var bugReport = appHooks.bugReportHook.update(bugReport) var params = [ MultipartFormData(key: "text", type: .text(value: bugReport.text)), @@ -77,6 +77,8 @@ class BugReportService: NSObject, BugReportServiceProtocol { if let userID = bugReport.userID { params.append(.init(key: "user_id", type: .text(value: userID))) + } else { + bugReport.githubLabels.append("login") } if let deviceID = bugReport.deviceID { @@ -88,8 +90,17 @@ class BugReportService: NSObject, BugReportServiceProtocol { params.append(.init(key: "device_keys", type: .text(value: compactKeys))) } + if let crashEventID = lastCrashEventID { + params.append(MultipartFormData(key: "crash_report", type: .text(value: ""))) + bugReport.githubLabels.append("crash") + } + params.append(contentsOf: defaultParams) + if InfoPlistReader.main.baseBundleIdentifier == "io.element.elementx.nightly" { + bugReport.githubLabels.append("Nightly") + } + for label in bugReport.githubLabels { params.append(MultipartFormData(key: "label", type: .text(value: label))) } @@ -101,10 +112,6 @@ class BugReportService: NSObject, BugReportServiceProtocol { } } - if let crashEventID = lastCrashEventID { - params.append(MultipartFormData(key: "crash_report", type: .text(value: ""))) - } - for url in bugReport.files { params.append(MultipartFormData(key: "file", type: .file(url: url))) } diff --git a/Enterprise b/Enterprise index 0c0b8ae6b..233f49aa2 160000 --- a/Enterprise +++ b/Enterprise @@ -1 +1 @@ -Subproject commit 0c0b8ae6bca5dfa18efcbc4c4a480bffde92ce89 +Subproject commit 233f49aa2063ef7113007e7ea6a90225be903e5e