mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
* Fixes #614 - Add the user and device identifiers to rageshakes * Add `base_bundle_identifier` to rageshakes
This commit is contained in:
@@ -78,10 +78,19 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
||||
SentrySDK.crash()
|
||||
}
|
||||
|
||||
func submitBugReport(_ bugReport: BugReport,
|
||||
progressListener: ProgressListener?) async throws -> SubmitBugReportResponse {
|
||||
var params = [MultipartFormData(key: "text", type: .text(value: bugReport.text))]
|
||||
// swiftlint:disable:next function_body_length
|
||||
func submitBugReport(_ bugReport: BugReport, progressListener: ProgressListener?) async throws -> SubmitBugReportResponse {
|
||||
var params = [
|
||||
MultipartFormData(key: "user_id", type: .text(value: bugReport.userID)),
|
||||
MultipartFormData(key: "text", type: .text(value: bugReport.text))
|
||||
]
|
||||
|
||||
if let deviceID = bugReport.deviceID {
|
||||
params.append(.init(key: "device_id", type: .text(value: deviceID)))
|
||||
}
|
||||
|
||||
params.append(contentsOf: defaultParams)
|
||||
|
||||
for label in bugReport.githubLabels {
|
||||
params.append(MultipartFormData(key: "label", type: .text(value: label)))
|
||||
}
|
||||
@@ -155,7 +164,8 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
||||
MultipartFormData(key: "user_language", type: .text(value: Bundle.elementLanguage ?? "null")),
|
||||
MultipartFormData(key: "fallback_language", type: .text(value: Bundle.elementFallbackLanguage ?? "null")),
|
||||
MultipartFormData(key: "local_time", type: .text(value: localTime)),
|
||||
MultipartFormData(key: "utc_time", type: .text(value: utcTime))
|
||||
MultipartFormData(key: "utc_time", type: .text(value: utcTime)),
|
||||
MultipartFormData(key: "base_bundle_identifier", type: .text(value: InfoPlistReader.main.baseBundleIdentifier))
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ import Foundation
|
||||
import UIKit
|
||||
|
||||
struct BugReport {
|
||||
let userID: String
|
||||
let deviceID: String?
|
||||
let text: String
|
||||
let includeLogs: Bool
|
||||
let includeCrashLog: Bool
|
||||
|
||||
@@ -21,7 +21,7 @@ struct MockUserSession: UserSessionProtocol {
|
||||
let sessionVerificationController: SessionVerificationControllerProxyProtocol? = nil
|
||||
var userID: String { clientProxy.userID }
|
||||
var isSoftLogout: Bool { clientProxy.isSoftLogout }
|
||||
var deviceId: String? { clientProxy.deviceId }
|
||||
var deviceID: String? { clientProxy.deviceId }
|
||||
var homeserver: String { clientProxy.homeserver }
|
||||
let clientProxy: ClientProxyProtocol
|
||||
let mediaProvider: MediaProviderProtocol
|
||||
|
||||
@@ -25,7 +25,7 @@ class UserSession: UserSessionProtocol {
|
||||
|
||||
var userID: String { clientProxy.userID }
|
||||
var isSoftLogout: Bool { clientProxy.isSoftLogout }
|
||||
var deviceId: String? { clientProxy.deviceId }
|
||||
var deviceID: String? { clientProxy.deviceId }
|
||||
var homeserver: String { clientProxy.homeserver }
|
||||
|
||||
let clientProxy: ClientProxyProtocol
|
||||
|
||||
@@ -25,10 +25,11 @@ enum UserSessionCallback {
|
||||
}
|
||||
|
||||
protocol UserSessionProtocol {
|
||||
var userID: String { get }
|
||||
var isSoftLogout: Bool { get }
|
||||
var deviceId: String? { get }
|
||||
var homeserver: String { get }
|
||||
var userID: String { get }
|
||||
var deviceID: String? { get }
|
||||
|
||||
var isSoftLogout: Bool { get }
|
||||
|
||||
var clientProxy: ClientProxyProtocol { get }
|
||||
var mediaProvider: MediaProviderProtocol { get }
|
||||
|
||||
@@ -244,6 +244,8 @@ class UserSessionFlowCoordinator: CoordinatorProtocol {
|
||||
let userIndicatorController = UserIndicatorController(rootCoordinator: feedbackNavigationStackCoordinator)
|
||||
|
||||
let parameters = BugReportCoordinatorParameters(bugReportService: bugReportService,
|
||||
userID: userSession.userID,
|
||||
deviceID: userSession.deviceID,
|
||||
userIndicatorController: userIndicatorController,
|
||||
screenshot: image,
|
||||
isModallyPresented: true)
|
||||
|
||||
Reference in New Issue
Block a user