mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-11 13:59:13 +00:00
Send the SDK's short git SHA to rageshakes
This commit is contained in:
parent
bf8d846090
commit
ebb7436927
@ -206,6 +206,7 @@ class AppCoordinator: AppCoordinatorProtocol, AuthenticationCoordinatorDelegate,
|
|||||||
ServiceLocator.shared.register(bugReportService: BugReportService(withBaseURL: ServiceLocator.shared.settings.bugReportServiceBaseURL,
|
ServiceLocator.shared.register(bugReportService: BugReportService(withBaseURL: ServiceLocator.shared.settings.bugReportServiceBaseURL,
|
||||||
sentryURL: ServiceLocator.shared.settings.bugReportSentryURL,
|
sentryURL: ServiceLocator.shared.settings.bugReportSentryURL,
|
||||||
applicationId: ServiceLocator.shared.settings.bugReportApplicationId,
|
applicationId: ServiceLocator.shared.settings.bugReportApplicationId,
|
||||||
|
sdkGitSHA: sdkGitSha(),
|
||||||
maxUploadSize: ServiceLocator.shared.settings.bugReportMaxUploadSize))
|
maxUploadSize: ServiceLocator.shared.settings.bugReportMaxUploadSize))
|
||||||
ServiceLocator.shared.register(analytics: AnalyticsService(client: PostHogAnalyticsClient(),
|
ServiceLocator.shared.register(analytics: AnalyticsService(client: PostHogAnalyticsClient(),
|
||||||
appSettings: ServiceLocator.shared.settings,
|
appSettings: ServiceLocator.shared.settings,
|
||||||
|
@ -24,6 +24,7 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
|||||||
private let baseURL: URL
|
private let baseURL: URL
|
||||||
private let sentryURL: URL
|
private let sentryURL: URL
|
||||||
private let applicationId: String
|
private let applicationId: String
|
||||||
|
private let sdkGitSHA: String
|
||||||
private let maxUploadSize: Int
|
private let maxUploadSize: Int
|
||||||
private let session: URLSession
|
private let session: URLSession
|
||||||
private var lastCrashEventId: String?
|
private var lastCrashEventId: String?
|
||||||
@ -33,11 +34,13 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
|||||||
init(withBaseURL baseURL: URL,
|
init(withBaseURL baseURL: URL,
|
||||||
sentryURL: URL,
|
sentryURL: URL,
|
||||||
applicationId: String,
|
applicationId: String,
|
||||||
|
sdkGitSHA: String,
|
||||||
maxUploadSize: Int,
|
maxUploadSize: Int,
|
||||||
session: URLSession = .shared) {
|
session: URLSession = .shared) {
|
||||||
self.baseURL = baseURL
|
self.baseURL = baseURL
|
||||||
self.sentryURL = sentryURL
|
self.sentryURL = sentryURL
|
||||||
self.applicationId = applicationId
|
self.applicationId = applicationId
|
||||||
|
self.sdkGitSHA = sdkGitSHA
|
||||||
self.maxUploadSize = maxUploadSize
|
self.maxUploadSize = maxUploadSize
|
||||||
self.session = session
|
self.session = session
|
||||||
super.init()
|
super.init()
|
||||||
@ -198,6 +201,7 @@ class BugReportService: NSObject, BugReportServiceProtocol {
|
|||||||
MultipartFormData(key: "app", type: .text(value: applicationId)),
|
MultipartFormData(key: "app", type: .text(value: applicationId)),
|
||||||
MultipartFormData(key: "version", type: .text(value: InfoPlistReader.main.bundleShortVersionString)),
|
MultipartFormData(key: "version", type: .text(value: InfoPlistReader.main.bundleShortVersionString)),
|
||||||
MultipartFormData(key: "build", type: .text(value: InfoPlistReader.main.bundleVersion)),
|
MultipartFormData(key: "build", type: .text(value: InfoPlistReader.main.bundleVersion)),
|
||||||
|
MultipartFormData(key: "sdk_sha", type: .text(value: sdkGitSHA)),
|
||||||
MultipartFormData(key: "os", type: .text(value: os)),
|
MultipartFormData(key: "os", type: .text(value: os)),
|
||||||
MultipartFormData(key: "resolved_languages", type: .text(value: Bundle.app.preferredLocalizations.joined(separator: ", "))),
|
MultipartFormData(key: "resolved_languages", type: .text(value: Bundle.app.preferredLocalizations.joined(separator: ", "))),
|
||||||
MultipartFormData(key: "user_languages", type: .text(value: Locale.preferredLanguages.joined(separator: ", "))),
|
MultipartFormData(key: "user_languages", type: .text(value: Locale.preferredLanguages.joined(separator: ", "))),
|
||||||
|
@ -51,6 +51,7 @@ class BugReportServiceTests: XCTestCase {
|
|||||||
let service = BugReportService(withBaseURL: "https://www.example.com",
|
let service = BugReportService(withBaseURL: "https://www.example.com",
|
||||||
sentryURL: "https://1234@sentry.com/1234",
|
sentryURL: "https://1234@sentry.com/1234",
|
||||||
applicationId: "mock_app_id",
|
applicationId: "mock_app_id",
|
||||||
|
sdkGitSHA: "1234",
|
||||||
maxUploadSize: ServiceLocator.shared.settings.bugReportMaxUploadSize,
|
maxUploadSize: ServiceLocator.shared.settings.bugReportMaxUploadSize,
|
||||||
session: .mock)
|
session: .mock)
|
||||||
XCTAssertFalse(service.crashedLastRun)
|
XCTAssertFalse(service.crashedLastRun)
|
||||||
@ -60,6 +61,7 @@ class BugReportServiceTests: XCTestCase {
|
|||||||
let service = BugReportService(withBaseURL: "https://www.example.com",
|
let service = BugReportService(withBaseURL: "https://www.example.com",
|
||||||
sentryURL: "https://1234@sentry.com/1234",
|
sentryURL: "https://1234@sentry.com/1234",
|
||||||
applicationId: "mock_app_id",
|
applicationId: "mock_app_id",
|
||||||
|
sdkGitSHA: "1234",
|
||||||
maxUploadSize: ServiceLocator.shared.settings.bugReportMaxUploadSize,
|
maxUploadSize: ServiceLocator.shared.settings.bugReportMaxUploadSize,
|
||||||
session: .mock)
|
session: .mock)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user