Skip to content

Commit

Permalink
Merge branch 'main' into feat/fatal-app-hangs
Browse files Browse the repository at this point in the history
  • Loading branch information
philipphofmann committed Feb 25, 2025
2 parents 7a66977 + 124e4ab commit f24ea22
Show file tree
Hide file tree
Showing 33 changed files with 304 additions and 100 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Features

- Report fatal app hangs (#4889) only when enabling the option `enableAppHangTrackingV2`
- New user feedback API and Widget (#4874)

### Improvements

Expand Down
Binary file added Samples/Shared/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
7B3427FB25876DDC00056519 /* Tongariro.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7B3427F925876DDB00056519 /* Tongariro.jpg */; };
7B64387A26A6C69F000D0F65 /* LaunchUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B64387926A6C69F000D0F65 /* LaunchUITests.swift */; };
7B8A5C9E2715B5DE008ACD3B /* InitializerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7B8A5C9D2715B5DE008ACD3B /* InitializerViewController.m */; };
849C4A6B2D66D05600FA632D /* screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = 849C4A6A2D66D05600FA632D /* screenshot.png */; };
84BA72AB2C9369A40045B828 /* GitInjections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84BA72A92C9369A40045B828 /* GitInjections.swift */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -51,6 +52,13 @@
remoteGlobalIDString = 637AFDC5243B036B0034958B;
remoteInfo = "iOS-ObjectiveC";
};
849C4A722D66D05600FA632D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 630853352440C45500DDE4CE /* Sentry.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D833D7342D1321C100961E7A;
remoteInfo = SentrySwiftUITests;
};
84BA72732C9367A10045B828 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 630853352440C45500DDE4CE /* Sentry.xcodeproj */;
Expand Down Expand Up @@ -116,6 +124,7 @@
7B64387B26A6C69F000D0F65 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7B8A5C9C2715B5CF008ACD3B /* InitializerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = InitializerViewController.h; sourceTree = "<group>"; };
7B8A5C9D2715B5DE008ACD3B /* InitializerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = InitializerViewController.m; sourceTree = "<group>"; };
849C4A6A2D66D05600FA632D /* screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screenshot.png; sourceTree = "<group>"; };
84BA72A92C9369A40045B828 /* GitInjections.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GitInjections.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -147,6 +156,7 @@
84BA72762C9367A10045B828 /* SentryProfilerTests.xctest */,
84BA72782C9367A10045B828 /* libSentryTestUtils.a */,
84BA727A2C9367A10045B828 /* SentryTestUtilsDynamic.framework */,
849C4A732D66D05600FA632D /* SentrySwiftUITests.xctest */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -213,6 +223,7 @@
84BA72AA2C9369A40045B828 /* Shared */ = {
isa = PBXGroup;
children = (
849C4A6A2D66D05600FA632D /* screenshot.png */,
84BA72A92C9369A40045B828 /* GitInjections.swift */,
);
name = Shared;
Expand Down Expand Up @@ -320,6 +331,13 @@
remoteRef = 6308533C2440C45500DDE4CE /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
849C4A732D66D05600FA632D /* SentrySwiftUITests.xctest */ = {
isa = PBXReferenceProxy;
fileType = wrapper.cfbundle;
path = SentrySwiftUITests.xctest;
remoteRef = 849C4A722D66D05600FA632D /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
84BA72742C9367A10045B828 /* SentrySwiftUI.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
Expand Down Expand Up @@ -359,6 +377,7 @@
637AFDD9243B036D0034958B /* LaunchScreen.storyboard in Resources */,
7B3427FB25876DDC00056519 /* Tongariro.jpg in Resources */,
637AFDD4243B036B0034958B /* Main.storyboard in Resources */,
849C4A6B2D66D05600FA632D /* screenshot.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
27 changes: 16 additions & 11 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -24,7 +23,7 @@
<nil key="highlightedColor"/>
</label>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="AVC-4r-eVc">
<rect key="frame" x="8" y="120.5" width="398" height="270"/>
<rect key="frame" x="8" y="120.5" width="398" height="300"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="rUC-at-hwU">
<rect key="frame" x="0.0" y="0.0" width="398" height="30"/>
Expand All @@ -45,47 +44,53 @@
<rect key="frame" x="0.0" y="60" width="398" height="30"/>
<state key="normal" title="captureUserFeedback"/>
<connections>
<action selector="captureMessage:" destination="BYZ-38-t0r" eventType="touchUpInside" id="dxD-CU-dxJ"/>
<action selector="captureUserFeedback:" destination="BYZ-38-t0r" eventType="touchUpInside" id="PfT-MW-tlq"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G9Q-jA-9Nd">
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GFX-14-5JR">
<rect key="frame" x="0.0" y="90" width="398" height="30"/>
<state key="normal" title="captureUserFeedbackV2"/>
<connections>
<action selector="captureUserFeedbackV2:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Teu-9p-m5v"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G9Q-jA-9Nd">
<rect key="frame" x="0.0" y="120" width="398" height="30"/>
<state key="normal" title="captureNSError"/>
<connections>
<action selector="captureError:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Btq-8D-8N6"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ugR-6E-UFA">
<rect key="frame" x="0.0" y="120" width="398" height="30"/>
<rect key="frame" x="0.0" y="150" width="398" height="30"/>
<state key="normal" title="captureNSException"/>
<connections>
<action selector="captureException:" destination="BYZ-38-t0r" eventType="touchUpInside" id="ezD-qB-SSr"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I9B-iL-of0">
<rect key="frame" x="0.0" y="150" width="398" height="30"/>
<rect key="frame" x="0.0" y="180" width="398" height="30"/>
<state key="normal" title="captureTransaction"/>
<connections>
<action selector="captureTransaction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="uaN-VO-vJA"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PFR-up-CPy">
<rect key="frame" x="0.0" y="180" width="398" height="30"/>
<rect key="frame" x="0.0" y="210" width="398" height="30"/>
<state key="normal" title="crash"/>
<connections>
<action selector="crash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="6xT-zA-EZI"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eUX-Yi-7fo">
<rect key="frame" x="0.0" y="210" width="398" height="30"/>
<rect key="frame" x="0.0" y="240" width="398" height="30"/>
<state key="normal" title="sigsevCrash"/>
<connections>
<action selector="sigsevCrash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Z0n-Rw-Tpu"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="7cg-k4-wJ5" userLabel="oomCrash">
<rect key="frame" x="0.0" y="240" width="398" height="30"/>
<rect key="frame" x="0.0" y="270" width="398" height="30"/>
<state key="normal" title="OOM Crash"/>
<connections>
<action selector="oomCrash:" destination="BYZ-38-t0r" eventType="touchUpInside" id="6Eb-uS-ljp"/>
Expand Down
22 changes: 22 additions & 0 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,28 @@ - (IBAction)captureUserFeedback:(id)sender
[SentrySDK captureUserFeedback:userFeedback];
}

- (IBAction)captureUserFeedbackV2:(id)sender
{
NSData *data = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"screenshot"
withExtension:@"png"]];
NSArray<NSData *> *attachments = nil;
if (data != nil) {
attachments = @[ data ];
}
SentryId *errorEventID =
[SentrySDK captureError:[NSError errorWithDomain:@"test-error.user-feedback.iOS-ObjectiveC"
code:1
userInfo:nil]];
SentryFeedback *feedback = [[SentryFeedback alloc]
initWithMessage:@"It broke again on iOS-ObjectiveC. I don't know why, but this happens."
name:@"John Me"
email:@"[email protected]"
source:SentryFeedbackSourceCustom
associatedEventId:errorEventID
attachments:attachments];
[SentrySDK captureFeedback:feedback];
}

- (IBAction)captureError:(id)sender
{
NSError *error =
Expand Down
4 changes: 4 additions & 0 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
844DA822282584F700E6B62E /* SentryData.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = D845F35927BAD4CC00A4D7A2 /* SentryData.xcdatamodeld */; };
847670302BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m in Sources */ = {isa = PBXBuildFile; fileRef = 8476702F2BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m */; };
848A256D286E3351008A8858 /* fatal-error-binary-images-message2.json in Resources */ = {isa = PBXBuildFile; fileRef = D83A30DF279F1F5C00372D0A /* fatal-error-binary-images-message2.json */; };
849C4A692D66CA1600FA632D /* screenshot.png in Resources */ = {isa = PBXBuildFile; fileRef = 849C4A682D66CA1600FA632D /* screenshot.png */; };
84A5D72629D2705000388BFA /* ProfilingUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D72529D2705000388BFA /* ProfilingUITests.swift */; };
84A5D72D29D2708D00388BFA /* UITestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A5D72C29D2708D00388BFA /* UITestHelpers.swift */; };
84AB90712A5001000054C99A /* ProfilingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AB90702A5001000054C99A /* ProfilingViewController.swift */; };
Expand Down Expand Up @@ -277,6 +278,7 @@
8476702F2BAA4AFA001A4E31 /* NSObject+SentryAppSetup.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSObject+SentryAppSetup.m"; sourceTree = "<group>"; };
848A2573286E3351008A8858 /* PerformanceBenchmarks.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PerformanceBenchmarks.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
848A2578286E3490008A8858 /* PerformanceBenchmarks-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PerformanceBenchmarks-Info.plist"; sourceTree = "<group>"; };
849C4A682D66CA1600FA632D /* screenshot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = screenshot.png; sourceTree = "<group>"; };
84A5D72529D2705000388BFA /* ProfilingUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfilingUITests.swift; sourceTree = "<group>"; };
84A5D72C29D2708D00388BFA /* UITestHelpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITestHelpers.swift; sourceTree = "<group>"; };
84AB90702A5001000054C99A /* ProfilingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfilingViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -548,6 +550,7 @@
isa = PBXGroup;
children = (
84BA72A52C93698E0045B828 /* GitInjections.swift */,
849C4A682D66CA1600FA632D /* screenshot.png */,
);
name = Shared;
path = ../Shared;
Expand Down Expand Up @@ -918,6 +921,7 @@
7B3427F825876A5200056519 /* Tongariro.jpg in Resources */,
637AFDB1243B02760034958B /* Main.storyboard in Resources */,
D8C484852CCF902F00503B14 /* SampleAssets.xcassets in Resources */,
849C4A692D66CA1600FA632D /* screenshot.png in Resources */,
D8FD68C42C1C86E300A70055 /* TableViewController.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
Loading

0 comments on commit f24ea22

Please sign in to comment.