Skip to content

Commit

Permalink
feat: Add flush
Browse files Browse the repository at this point in the history
Add blocking flush to send out all envelope items.

Fixes GH-1013
  • Loading branch information
philipphofmann committed Sep 12, 2022
1 parent 91fc76f commit 51696d1
Show file tree
Hide file tree
Showing 22 changed files with 315 additions and 28 deletions.
36 changes: 22 additions & 14 deletions Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<stackView opaque="NO" contentMode="scaleAspectFit" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="480-5y-FtF">
<rect key="frame" x="8" y="227.5" width="398" height="495.5"/>
<rect key="frame" x="8" y="222" width="398" height="506.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" distribution="fillProportionally" alignment="top" translatesAutoresizingMaskIntoConstraints="NO" id="VbH-LD-DBn">
<rect key="frame" x="0.0" y="0.0" width="398" height="330"/>
<rect key="frame" x="0.0" y="0.0" width="398" height="341"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="hHG-as-TfH">
<rect key="frame" x="0.0" y="0.0" width="181.5" height="330"/>
Expand Down Expand Up @@ -108,91 +108,99 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" translatesAutoresizingMaskIntoConstraints="NO" id="1a2-Yg-Az9">
<rect key="frame" x="181.5" y="0.0" width="216.5" height="300"/>
<rect key="frame" x="181.5" y="0.0" width="216.5" height="341"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Yi7-GN-26l">
<rect key="frame" x="0.0" y="0.0" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="0.0" width="216.5" height="31"/>
<state key="normal" title="ANR fully blocking"/>
<connections>
<action selector="anrFullyBlocking:" destination="BYZ-38-t0r" eventType="touchUpInside" id="dJy-Fs-khK"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="TSF-10-5ts">
<rect key="frame" x="0.0" y="30" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="31" width="216.5" height="31"/>
<state key="normal" title="ANR filling run loop"/>
<connections>
<action selector="anrFillingRunLoop:" destination="BYZ-38-t0r" eventType="touchUpInside" id="13D-io-hVz"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cdR-H3-8fr">
<rect key="frame" x="0.0" y="60" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="62" width="216.5" height="31"/>
<state key="normal" title="Capture Transaction"/>
<connections>
<action selector="captureTransaction:" destination="BYZ-38-t0r" eventType="touchUpInside" id="kff-pT-Uf4"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Jwi-v3-e8T">
<rect key="frame" x="0.0" y="90" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="93" width="216.5" height="31"/>
<accessibility key="accessibilityConfiguration" identifier="loremIpsumButton"/>
<state key="normal" title="Lorem Ipsum"/>
<connections>
<segue destination="2jd-n4-Ihk" kind="show" id="wcP-y8-kPR"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8CV-WC-ffq">
<rect key="frame" x="0.0" y="120" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="124" width="216.5" height="31"/>
<accessibility key="accessibilityConfiguration" identifier="testNavigationTransactionButton"/>
<state key="normal" title="Image"/>
<connections>
<segue destination="cay-7M-Gvd" kind="show" id="boD-GG-VVF"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="LvU-yx-01i">
<rect key="frame" x="0.0" y="150" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="155" width="216.5" height="31"/>
<accessibility key="accessibilityConfiguration" identifier="showNibButton"/>
<state key="normal" title="Show Nib"/>
<connections>
<action selector="showNibController:" destination="BYZ-38-t0r" eventType="touchUpInside" id="E8m-GA-zvY"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RjO-LN-eHj">
<rect key="frame" x="0.0" y="180" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="186" width="216.5" height="31"/>
<accessibility key="accessibilityConfiguration" identifier="showTableViewButton"/>
<state key="normal" title="TableView"/>
<connections>
<action selector="showTableViewController:" destination="BYZ-38-t0r" eventType="touchUpInside" id="u6U-9d-UMi"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ok0-hq-2kK">
<rect key="frame" x="0.0" y="210" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="217" width="216.5" height="31"/>
<accessibility key="accessibilityConfiguration" identifier="showSplitViewButton"/>
<state key="normal" title="SplitView"/>
<connections>
<segue destination="DGj-BO-BQ5" kind="presentation" id="G2z-UO-upZ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cTC-V8-T1j">
<rect key="frame" x="0.0" y="240" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="248" width="216.5" height="31"/>
<accessibility key="accessibilityConfiguration" identifier="useCoreData"/>
<state key="normal" title="Core Data"/>
<connections>
<action selector="useCoreData:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Ycl-fG-7Bk"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Ld2-mz-wQD">
<rect key="frame" x="0.0" y="270" width="216.5" height="30"/>
<rect key="frame" x="0.0" y="279" width="216.5" height="31"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="Performance scenarios"/>
<connections>
<action selector="performanceScenarios:" destination="BYZ-38-t0r" eventType="touchUpInside" id="cuc-qv-hNv"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WRX-HQ-DjW">
<rect key="frame" x="0.0" y="310" width="216.5" height="31"/>
<state key="normal" title="Button"/>
<buttonConfiguration key="configuration" style="plain" title="Flush"/>
<connections>
<action selector="flush:" destination="BYZ-38-t0r" eventType="touchUpInside" id="FZC-ku-RYU"/>
</connections>
</button>
</subviews>
</stackView>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="UrL-kT-AJU">
<rect key="frame" x="0.0" y="330" width="398" height="165.5"/>
<rect key="frame" x="0.0" y="341" width="398" height="165.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="DSN " textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="m3h-wb-Xfa">
<rect key="frame" x="8" y="32" width="382" height="20.5"/>
Expand Down
5 changes: 5 additions & 0 deletions Samples/iOS-Swift/iOS-Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,9 @@ class ViewController: UIViewController {
controller.title = "Permissions"
navigationController?.pushViewController(controller, animated: true)
}

@IBAction func flush(_ sender: Any) {
SentrySDK.flush(timeout: 5)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,46 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/watchOS-Swift WatchKit App">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B82C48224C98A93002CA6D1"
BuildableName = "watchOS-Swift WatchKit App.app"
BlueprintName = "watchOS-Swift WatchKit App"
ReferencedContainer = "container:watchOS-Swift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/watchOS-Swift WatchKit App">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B82C48224C98A93002CA6D1"
BuildableName = "watchOS-Swift WatchKit App.app"
BlueprintName = "watchOS-Swift WatchKit App"
ReferencedContainer = "container:watchOS-Swift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B82C48224C98A93002CA6D1"
BuildableName = "watchOS-Swift WatchKit App.app"
BlueprintName = "watchOS-Swift WatchKit App"
ReferencedContainer = "container:watchOS-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Loading

0 comments on commit 51696d1

Please sign in to comment.