diff --git a/.github/workflows/ios_emerge_upload_main.yml b/.github/workflows/ios_emerge_upload_main.yml index 918396c9..0eb79c77 100644 --- a/.github/workflows/ios_emerge_upload_main.yml +++ b/.github/workflows/ios_emerge_upload_main.yml @@ -1,8 +1,9 @@ name: Sentry iOS Upload (Size Analysis) on: - push: + pull_request: branches: [main] + paths: [ios/**] jobs: build: diff --git a/ios/HackerNews.xcodeproj/project.pbxproj b/ios/HackerNews.xcodeproj/project.pbxproj index 742c85a8..a87175c0 100644 --- a/ios/HackerNews.xcodeproj/project.pbxproj +++ b/ios/HackerNews.xcodeproj/project.pbxproj @@ -15,14 +15,11 @@ A49D686D2DE8EB1F00E44A18 /* Linkmap.txt in Resources */ = {isa = PBXBuildFile; fileRef = A49D686C2DE8EB1F00E44A18 /* Linkmap.txt */; }; A4B6CF932D49949200077F66 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4B6CF922D49949200077F66 /* WidgetKit.framework */; }; A4B6CF952D49949200077F66 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A4B6CF942D49949200077F66 /* SwiftUI.framework */; }; - A4B6CFA02D49949300077F66 /* HackerNewsHomeWidgetExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = A4B6CF912D49949200077F66 /* HackerNewsHomeWidgetExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; A4BED5C32AD5E083001642B3 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; A4BED5C42AD5E083001642B3 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; A4D28AEE2C237E2A007F20D0 /* SnapshotPreferences in Frameworks */ = {isa = PBXBuildFile; productRef = A4D28AED2C237E2A007F20D0 /* SnapshotPreferences */; }; A4D28AF02C237E2A007F20D0 /* SnapshottingTests in Frameworks */ = {isa = PBXBuildFile; productRef = A4D28AEF2C237E2A007F20D0 /* SnapshottingTests */; }; - A9DF68FF511E48048B0A703D /* Sentry in Frameworks */ = {isa = PBXBuildFile; productRef = 673236B0A4D04137A0D80A76 /* Sentry */; }; C3AC6AD92CB6E8F7006BD22D /* SnapshottingTests in Frameworks */ = {isa = PBXBuildFile; productRef = C3AC6AD82CB6E8F7006BD22D /* SnapshottingTests */; }; - F40E42A02EA80E1600E53876 /* SentrySwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = F40E429F2EA80E1600E53876 /* SentrySwiftUI */; }; F45F6EA52D4D1E50003FA9A3 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = F45F6EA42D4D1E50003FA9A3 /* Common */; }; F45F6EA72D4D1E57003FA9A3 /* Common in Frameworks */ = {isa = PBXBuildFile; productRef = F45F6EA62D4D1E57003FA9A3 /* Common */; }; F45F6F4A2D4D2185003FA9A3 /* Common in Embed Frameworks */ = {isa = PBXBuildFile; productRef = F45F6EA42D4D1E50003FA9A3 /* Common */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; @@ -37,16 +34,10 @@ FA3637612EC7AC7D00541313 /* AccessibilitySnapshotCore in Frameworks */ = {isa = PBXBuildFile; productRef = FA3637602EC7AC7D00541313 /* AccessibilitySnapshotCore */; }; FA3637642EC7ACAD00541313 /* AccessibilitySnapshotCore in Frameworks */ = {isa = PBXBuildFile; productRef = FA3637632EC7ACAD00541313 /* AccessibilitySnapshotCore */; }; FA80C2702EC78D7500A700AB /* AccessibilitySnapshotCore in Frameworks */ = {isa = PBXBuildFile; productRef = FA80C26F2EC78D7500A700AB /* AccessibilitySnapshotCore */; }; + FA914E352ECE6A4700C54BDD /* SentrySPM in Frameworks */ = {isa = PBXBuildFile; productRef = FA914E342ECE6A4700C54BDD /* SentrySPM */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - A411AEA02D4A82CA0067FB97 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A42705712A4293B10057E439 /* Project object */; - proxyType = 1; - remoteGlobalIDString = A4B6CF902D49949200077F66; - remoteInfo = HackerNewsHomeWidgetExtension; - }; A427058A2A4293B30057E439 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A42705712A4293B10057E439 /* Project object */; @@ -64,17 +55,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - A4B6CFA22D49949300077F66 /* Embed Foundation Extensions */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 13; - files = ( - A4B6CFA02D49949300077F66 /* HackerNewsHomeWidgetExtension.appex in Embed Foundation Extensions */, - ); - name = "Embed Foundation Extensions"; - runOnlyForDeploymentPostprocessing = 0; - }; A4D28AE92C237BAE007F20D0 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -193,12 +173,11 @@ files = ( F45F6EA52D4D1E50003FA9A3 /* Common in Frameworks */, A47309B42AA29D9600201376 /* SwiftSoup in Frameworks */, + FA914E352ECE6A4700C54BDD /* SentrySPM in Frameworks */, F48E9ECB2D4D691600FD8B30 /* ETDistribution in Frameworks */, A4D28AEE2C237E2A007F20D0 /* SnapshotPreferences in Frameworks */, F45F703E2D4D2695003FA9A3 /* Fonts in Frameworks */, - F40E42A02EA80E1600E53876 /* SentrySwiftUI in Frameworks */, A495B2952BFEA11B00A8A8A9 /* Reaper in Frameworks */, - A9DF68FF511E48048B0A703D /* Sentry in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -357,14 +336,12 @@ A42705762A4293B10057E439 /* Frameworks */, A42705772A4293B10057E439 /* Resources */, A4D28AE92C237BAE007F20D0 /* Embed Frameworks */, - A4B6CFA22D49949300077F66 /* Embed Foundation Extensions */, A42705AE2A44C35D0057E439 /* Strip Symbols */, F45F6F4B2D4D2339003FA9A3 /* Remove duplicated bundles */, ); buildRules = ( ); dependencies = ( - A411AEA12D4A82CA0067FB97 /* PBXTargetDependency */, ); fileSystemSynchronizedGroups = ( A43900DA2D483D6100FE51DD /* HackerNews */, @@ -372,13 +349,12 @@ name = HackerNews; packageProductDependencies = ( A47309B32AA29D9600201376 /* SwiftSoup */, - 673236B0A4D04137A0D80A76 /* Sentry */, A495B2942BFEA11B00A8A8A9 /* Reaper */, A4D28AED2C237E2A007F20D0 /* SnapshotPreferences */, F45F6EA42D4D1E50003FA9A3 /* Common */, F45F703D2D4D2695003FA9A3 /* Fonts */, F48E9ECA2D4D691600FD8B30 /* ETDistribution */, - F40E429F2EA80E1600E53876 /* SentrySwiftUI */, + FA914E342ECE6A4700C54BDD /* SentrySPM */, ); productName = HackerNews; productReference = A42705792A4293B10057E439 /* HackerNews.app */; @@ -623,11 +599,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - A411AEA12D4A82CA0067FB97 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = A4B6CF902D49949200077F66 /* HackerNewsHomeWidgetExtension */; - targetProxy = A411AEA02D4A82CA0067FB97 /* PBXContainerItemProxy */; - }; A427058B2A4293B30057E439 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A42705782A4293B10057E439 /* HackerNews */; @@ -1231,8 +1202,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/getsentry/sentry-cocoa/"; requirement = { - kind = exactVersion; - version = "9.0.0-alpha.1"; + branch = mxTesting; + kind = branch; }; }; A42271692DE78DEF002F03D5 /* XCRemoteSwiftPackageReference "faultordering" */ = { @@ -1302,11 +1273,6 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 673236B0A4D04137A0D80A76 /* Sentry */ = { - isa = XCSwiftPackageProductDependency; - package = 995A2BEDEF224F7085D3DB13 /* XCRemoteSwiftPackageReference "sentry-cocoa" */; - productName = Sentry; - }; A422716A2DE78DEF002F03D5 /* FaultOrdering */ = { isa = XCSwiftPackageProductDependency; package = A42271692DE78DEF002F03D5 /* XCRemoteSwiftPackageReference "faultordering" */; @@ -1347,11 +1313,6 @@ package = A4D28AEC2C237E2A007F20D0 /* XCRemoteSwiftPackageReference "SnapshotPreviews" */; productName = SnapshottingTests; }; - F40E429F2EA80E1600E53876 /* SentrySwiftUI */ = { - isa = XCSwiftPackageProductDependency; - package = 995A2BEDEF224F7085D3DB13 /* XCRemoteSwiftPackageReference "sentry-cocoa" */; - productName = SentrySwiftUI; - }; F45F6EA42D4D1E50003FA9A3 /* Common */ = { isa = XCSwiftPackageProductDependency; package = F45F6E532D4D1D3E003FA9A3 /* XCLocalSwiftPackageReference "Packages/Common" */; @@ -1401,6 +1362,11 @@ package = FA80C26E2EC78D7500A700AB /* XCRemoteSwiftPackageReference "AccessibilitySnapshot" */; productName = AccessibilitySnapshotCore; }; + FA914E342ECE6A4700C54BDD /* SentrySPM */ = { + isa = XCSwiftPackageProductDependency; + package = 995A2BEDEF224F7085D3DB13 /* XCRemoteSwiftPackageReference "sentry-cocoa" */; + productName = SentrySPM; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = A42705712A4293B10057E439 /* Project object */; diff --git a/ios/HackerNews.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/ios/HackerNews.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index f74453c2..cee8fe63 100644 --- a/ios/HackerNews.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/ios/HackerNews.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "cd279061071a9be804a18a197dd9701ac5708de79c458383a585d24b3f0df7d0", + "originHash" : "31753152508674c3b53b9ec503f6ba91dc92abc617d5323b0229848309b174a9", "pins" : [ { "identity" : "accessibilitysnapshotios26", @@ -7,7 +7,7 @@ "location" : "https://github.com/EmergeTools/AccessibilitySnapshotios26", "state" : { "branch" : "main", - "revision" : "2e2ece6a050a240f03c14da4d126a97f04c7b7d4" + "revision" : "70f4e47e14df54fdeba9d0ce447da3d9eb62cacf" } }, { @@ -58,10 +58,10 @@ { "identity" : "sentry-cocoa", "kind" : "remoteSourceControl", - "location" : "https://github.com/getsentry/sentry-cocoa", + "location" : "https://github.com/getsentry/sentry-cocoa/", "state" : { - "revision" : "0011afdaef35cf7301482fbc501b1204b3edb231", - "version" : "9.0.0-alpha.1" + "branch" : "mxTesting", + "revision" : "8413dfb70f9939f1ecc66aedd8fbba5f9648e4c0" } }, { @@ -78,7 +78,7 @@ "location" : "https://github.com/EmergeTools/SnapshotPreviews", "state" : { "branch" : "main", - "revision" : "1b3bd9bb341de85d927a78ad8874a35d081a8a66" + "revision" : "6dfb281493e48e7c09ae9717593ae0b8eb47b15c" } }, { diff --git a/ios/HackerNews/Bookmarks/BookmarksScreen.swift b/ios/HackerNews/Bookmarks/BookmarksScreen.swift index 86ae1884..8c334cdb 100644 --- a/ios/HackerNews/Bookmarks/BookmarksScreen.swift +++ b/ios/HackerNews/Bookmarks/BookmarksScreen.swift @@ -7,7 +7,6 @@ import Foundation import SwiftUI -import SentrySwiftUI struct BookmarksScreen: View { @Binding var model: AppViewModel @@ -53,7 +52,6 @@ struct BookmarksScreen: View { } .frame(height: 60) } - .sentryTrace("BookmarksScreen") } } diff --git a/ios/HackerNews/Feed/FeedScreen.swift b/ios/HackerNews/Feed/FeedScreen.swift index ba445a73..a66209d1 100644 --- a/ios/HackerNews/Feed/FeedScreen.swift +++ b/ios/HackerNews/Feed/FeedScreen.swift @@ -8,12 +8,17 @@ import Foundation import SwiftUI import Common -import SentrySwiftUI struct FeedScreen: View { @Binding var model: AppViewModel @State private var isAnimating = false + + func crash() { + let a = "" + let b = (a as Any) as! Date + print(b) + } var body: some View { VStack(spacing: 8) { @@ -45,6 +50,10 @@ struct FeedScreen: View { } } .frame(height: 60) + Button("Crash") { + print("going to crash") + crash() + } // Page view for feeds TabView(selection: $model.feedState.selectedFeed) { @@ -64,7 +73,6 @@ struct FeedScreen: View { } } .tabViewStyle(.page(indexDisplayMode: .never)) - .sentryTrace("FeedScreen") } } } @@ -127,7 +135,6 @@ private struct FeedListView: View { try? await Task.sleep(for: .milliseconds(300)) await model.fetchInitialPosts(feedType: model.feedState.selectedFeed) } - .sentryTrace("FeedListView") } } diff --git a/ios/HackerNews/HNApp.swift b/ios/HackerNews/HNApp.swift index fd9fd5cf..4ecef5fa 100644 --- a/ios/HackerNews/HNApp.swift +++ b/ios/HackerNews/HNApp.swift @@ -6,7 +6,7 @@ // import Reaper -import Sentry +import SentrySwift import SwiftData import SwiftUI import Common @@ -42,6 +42,7 @@ struct HackerNewsApp: App { options.sessionReplay.onErrorSampleRate = 1.0 options.sendDefaultPii = true options.enableLogs = true + options.experimental.enableSessionReplayInUnreliableEnvironment = true #if DEBUG options.environment = "development" diff --git a/ios/HackerNews/Localizable.xcstrings b/ios/HackerNews/Localizable.xcstrings index 922ba063..c1e0e18d 100644 --- a/ios/HackerNews/Localizable.xcstrings +++ b/ios/HackerNews/Localizable.xcstrings @@ -208,6 +208,9 @@ } } } + }, + "Crash" : { + }, "feed.type.ask" : { "extractionState" : "manual", diff --git a/ios/HackerNews/Settings/SendFeedbackScreen.swift b/ios/HackerNews/Settings/SendFeedbackScreen.swift index ac25eac8..08b27d11 100644 --- a/ios/HackerNews/Settings/SendFeedbackScreen.swift +++ b/ios/HackerNews/Settings/SendFeedbackScreen.swift @@ -5,7 +5,7 @@ // Created by Trevor Elkins on 4/16/25. // -import Sentry +import SentrySwift import SwiftUI struct SendFeedbackScreen: View { diff --git a/ios/HackerNews/Settings/SettingsScreen.swift b/ios/HackerNews/Settings/SettingsScreen.swift index 83497d74..635c2bb7 100644 --- a/ios/HackerNews/Settings/SettingsScreen.swift +++ b/ios/HackerNews/Settings/SettingsScreen.swift @@ -8,7 +8,6 @@ import Foundation import SwiftUI import Common -import SentrySwiftUI struct SettingsScreen: View { @Binding var model: AppViewModel @@ -270,7 +269,6 @@ struct SettingsScreen: View { .sheet(isPresented: $isShowingFeedback) { SendFeedbackScreen() } - .sentryTrace("SettingsScreen") } } diff --git a/ios/HackerNews/Utils/Assert.swift b/ios/HackerNews/Utils/Assert.swift index 4c85ba57..50aba130 100644 --- a/ios/HackerNews/Utils/Assert.swift +++ b/ios/HackerNews/Utils/Assert.swift @@ -6,7 +6,7 @@ // import Foundation -import Sentry +import SentrySwift /// Fails fast in Debug, logs to Sentry in Release. /// - Parameters: @@ -23,7 +23,7 @@ public func et_assertionFailure( #if DEBUG fatalError("\(message()) — \(function) @ \(file):\(line)") #else - let scope = Sentry.Scope() + let scope = SentrySwift.Scope() scope.setTag(value: "assertion", key: "type") let sentryId = SentrySDK.capture(message: message(), scope: scope) print("Created Sentry event \(sentryId)") diff --git a/ios/HackerNews/Utils/Logger.swift b/ios/HackerNews/Utils/Logger.swift index ad320e40..36d0f2b3 100644 --- a/ios/HackerNews/Utils/Logger.swift +++ b/ios/HackerNews/Utils/Logger.swift @@ -1,4 +1,4 @@ -import Sentry +import SentrySwift struct Logger { static func info(_ message: String) {