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:
Stefan Ceriu
2022-09-12 21:34:53 +03:00
committed by GitHub
parent 4006cc6b80
commit 4660f096f8
25 changed files with 414 additions and 103 deletions
@@ -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.