Update Sentry SDK

This commit is contained in:
Shadowfacts 2023-01-27 22:39:15 -05:00
parent d8901b38f5
commit aec5c0b787
7 changed files with 19 additions and 18 deletions

View File

@ -2851,7 +2851,7 @@
repositoryURL = "https://github.com/getsentry/sentry-cocoa.git"; repositoryURL = "https://github.com/getsentry/sentry-cocoa.git";
requirement = { requirement = {
kind = upToNextMinorVersion; kind = upToNextMinorVersion;
minimumVersion = 7.29.0; minimumVersion = 8.0.0;
}; };
}; };
D6552365289870790048A653 /* XCRemoteSwiftPackageReference "ScreenCorners" */ = { D6552365289870790048A653 /* XCRemoteSwiftPackageReference "ScreenCorners" */ = {

View File

@ -269,5 +269,5 @@ private func setInstanceBreadcrumb(instance: Instance, nodeInfo: NodeInfo?) {
"version": nodeInfo.software.version, "version": nodeInfo.software.version,
] ]
} }
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
} }

View File

@ -66,13 +66,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options.enableSwizzling = false options.enableSwizzling = false
// required to support releases/release health // required to support releases/release health
options.enableAutoSessionTracking = true options.enableAutoSessionTracking = true
options.enableOutOfMemoryTracking = false options.enableWatchdogTerminationTracking = false
options.enableAutoPerformanceTracking = false options.enableAutoPerformanceTracing = false
options.enableNetworkTracking = false options.enableNetworkTracking = false
options.enableAppHangTracking = false options.enableAppHangTracking = false
options.enableCoreDataTracking = false options.enableCoreDataTracing = false
// we don't care about events like battery, keyboard show/hide // we don't care about events like battery, keyboard show/hide
options.enableAutoBreadcrumbTracking = false options.enableAutoBreadcrumbTracking = false
options.enableUserInteractionTracing = false
options.beforeSend = { event in options.beforeSend = { event in
// just no, why would anyone need this information // just no, why would anyone need this information

View File

@ -211,7 +211,7 @@ class MastodonCachePersistentStore: NSPersistentCloudKitContainer {
} }
] ]
} }
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
fatalError("Unable to save managed object context: \(String(describing: error))") fatalError("Unable to save managed object context: \(String(describing: error))")
} }
} }

View File

@ -118,7 +118,7 @@ class NotificationsTableViewController: DiffableTimelineLikeTableViewController<
"created_at": notification.createdAt.formatted(.iso8601), "created_at": notification.createdAt.formatted(.iso8601),
"account": notification.account.id, "account": notification.account.id,
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
fatalError("missing status for \(group.kind) notification") fatalError("missing status for \(group.kind) notification")
} }
cell.updateUI(statusID: status.id, state: group.statusState!) cell.updateUI(statusID: status.id, state: group.statusState!)
@ -173,7 +173,7 @@ class NotificationsTableViewController: DiffableTimelineLikeTableViewController<
"created_at": notif.createdAt.formatted(.iso8601), "created_at": notif.createdAt.formatted(.iso8601),
"account": notif.account.id, "account": notif.account.id,
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
} }
} }

View File

@ -363,7 +363,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
crumb.data = [ crumb.data = [
"statusIDs": position.statusIDs, "statusIDs": position.statusIDs,
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
}() }()
let originalPositionStatusIDs = position.statusIDs let originalPositionStatusIDs = position.statusIDs
@ -377,7 +377,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
crumb.data = [ crumb.data = [
"unloaded": unloaded "unloaded": unloaded
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
}() }()
let results = await withTaskGroup(of: (String, Result<Status, Swift.Error>).self) { group -> [(String, Result<Status, Swift.Error>)] in let results = await withTaskGroup(of: (String, Result<Status, Swift.Error>).self) { group -> [(String, Result<Status, Swift.Error>)] in
for id in unloaded { for id in unloaded {
@ -401,7 +401,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
statuses.append(status) statuses.append(status)
let crumb = Breadcrumb(level: .info, category: "TimelineViewController") let crumb = Breadcrumb(level: .info, category: "TimelineViewController")
crumb.message = "Loaded status \(id)" crumb.message = "Loaded status \(id)"
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
case .failure(let error): case .failure(let error):
let crumb = Breadcrumb(level: .error, category: "TimelineViewController") let crumb = Breadcrumb(level: .error, category: "TimelineViewController")
crumb.message = "Error loading status" crumb.message = "Error loading status"
@ -409,7 +409,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
"error": String(describing: error), "error": String(describing: error),
"id": id "id": id
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
} }
} }
await mastodonController.persistentContainer.addAll(statuses: statuses, in: mastodonController.persistentContainer.viewContext) await mastodonController.persistentContainer.addAll(statuses: statuses, in: mastodonController.persistentContainer.viewContext)
@ -420,14 +420,14 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
crumb.data = [ crumb.data = [
"statusIDs": position.statusIDs, "statusIDs": position.statusIDs,
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
}() }()
// if an icloud sync completed in between starting to load the statuses and finishing, try to load again // if an icloud sync completed in between starting to load the statuses and finishing, try to load again
if position.statusIDs != originalPositionStatusIDs { if position.statusIDs != originalPositionStatusIDs {
let crumb = Breadcrumb(level: .info, category: "TimelineViewController") let crumb = Breadcrumb(level: .info, category: "TimelineViewController")
crumb.message = "TimelinePosition statusIDs changed, retrying load" crumb.message = "TimelinePosition statusIDs changed, retrying load"
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
return await loadStatusesToRestore(position: position) return await loadStatusesToRestore(position: position)
} }
@ -450,7 +450,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
crumb.data = [ crumb.data = [
"statusIDs": position.statusIDs, "statusIDs": position.statusIDs,
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
}() }()
return !position.statusIDs.isEmpty return !position.statusIDs.isEmpty
@ -469,7 +469,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
crumb.data = [ crumb.data = [
"statusIDs": position.statusIDs "statusIDs": position.statusIDs
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
dataSource.apply(snapshot, animatingDifferences: false) { dataSource.apply(snapshot, animatingDifferences: false) {
if let centerStatusID, if let centerStatusID,
let index = statusIDs.firstIndex(of: centerStatusID), let index = statusIDs.firstIndex(of: centerStatusID),
@ -506,7 +506,7 @@ class TimelineViewController: UIViewController, TimelineLikeCollectionViewContro
guard let status = self.mastodonController.persistentContainer.status(for: statusID) else { guard let status = self.mastodonController.persistentContainer.status(for: statusID) else {
let crumb = Breadcrumb(level: .fatal, category: "TimelineViewController") let crumb = Breadcrumb(level: .fatal, category: "TimelineViewController")
crumb.message = "Looking up status \(statusID)" crumb.message = "Looking up status \(statusID)"
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
preconditionFailure("Missing status for filtering") preconditionFailure("Missing status for filtering")
} }
// if the status is a reblog of another one, filter based on that one // if the status is a reblog of another one, filter based on that one

View File

@ -75,7 +75,7 @@ class ActionNotificationGroupTableViewCell: UITableViewCell {
"created_at": firstNotification.createdAt.formatted(.iso8601), "created_at": firstNotification.createdAt.formatted(.iso8601),
"account": firstNotification.account.id, "account": firstNotification.account.id,
] ]
SentrySDK.addBreadcrumb(crumb: crumb) SentrySDK.addBreadcrumb(crumb)
fatalError("missing status for favorite/reblog notification") fatalError("missing status for favorite/reblog notification")
} }
self.statusID = status.id self.statusID = status.id