mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fixes vector-im/element-x-ios/issues/117 - Event permalink timeline action
* moved NSRegularExpression outside of the AttributedString builder into the MatrixEntityRegex * fixed eventId v3 regex * added permalink builders for users, room identifiers and aliases, and events * added timeline item permalink contextual menu actions and error alerts * added an app wide ServiceLocator and moved the top level userIndicatorPresenter to it. * added URL constructor that takes a StaticString and returns an non-optional * Include Unit and UI tests in the swiftlint search paths
This commit is contained in:
@@ -20,40 +20,29 @@ import MatrixRustSDK
|
||||
import Sentry
|
||||
import UIKit
|
||||
|
||||
enum BugReportServiceError: Error {
|
||||
case invalidBaseUrlString
|
||||
case invalidSentryEndpoint
|
||||
}
|
||||
|
||||
class BugReportService: BugReportServiceProtocol {
|
||||
private let baseURL: URL
|
||||
private let sentryEndpoint: String
|
||||
private let sentryURL: URL
|
||||
private let applicationId: String
|
||||
private let session: URLSession
|
||||
private var lastCrashEventId: String?
|
||||
|
||||
init(withBaseUrlString baseUrlString: String,
|
||||
sentryEndpoint: String,
|
||||
|
||||
init(withBaseURL baseURL: URL,
|
||||
sentryURL: URL,
|
||||
applicationId: String = BuildSettings.bugReportApplicationId,
|
||||
session: URLSession = .shared) throws {
|
||||
guard let url = URL(string: baseUrlString) else {
|
||||
throw BugReportServiceError.invalidBaseUrlString
|
||||
}
|
||||
guard !sentryEndpoint.isEmpty else {
|
||||
throw BugReportServiceError.invalidSentryEndpoint
|
||||
}
|
||||
baseURL = url
|
||||
self.sentryEndpoint = sentryEndpoint
|
||||
session: URLSession = .shared) {
|
||||
self.baseURL = baseURL
|
||||
self.sentryURL = sentryURL
|
||||
self.applicationId = applicationId
|
||||
self.session = session
|
||||
|
||||
|
||||
// enable SentrySDK
|
||||
SentrySDK.start { options in
|
||||
#if DEBUG
|
||||
options.enabled = false
|
||||
#endif
|
||||
|
||||
options.dsn = sentryEndpoint
|
||||
options.dsn = sentryURL.absoluteString
|
||||
|
||||
// Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
|
||||
// We recommend adjusting this value in production.
|
||||
|
||||
Reference in New Issue
Block a user