Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
28a3d2b
feat: add config
ioannisj Nov 13, 2025
f74ed8b
feat: add base error capture
ioannisj Nov 27, 2025
250df1a
fix: package path
ioannisj Nov 27, 2025
fd35022
feat: add client-side swift demangling
ioannisj Nov 27, 2025
660e839
feat: improve public api
ioannisj Nov 27, 2025
530bd39
feat: add binary images
ioannisj Nov 28, 2025
eb51920
fix: swift error message
ioannisj Nov 28, 2025
1f053f9
fix:
ioannisj Dec 2, 2025
e97cf3b
feat: add PostHogStackFrame
ioannisj Dec 2, 2025
2a77d54
fix: synthetic
ioannisj Dec 2, 2025
f15c3be
feat: add capture async error example
ioannisj Dec 4, 2025
1d0a159
feat: remove swift symbol demangling
ioannisj Dec 4, 2025
bc6171b
fix: skip top posthog frames
ioannisj Dec 4, 2025
62e0a8d
fix: remove strip symbols script
ioannisj Dec 4, 2025
fce9076
fix: update sample project release config
ioannisj Dec 4, 2025
315530c
fix: avoid force unwrap
ioannisj Dec 4, 2025
b121d02
fix: add helper
ioannisj Dec 4, 2025
cc4abb8
fix: hex constant
ioannisj Dec 10, 2025
72566dd
fix: update platform
ioannisj Dec 10, 2025
6c836a4
fix: update some comments
ioannisj Dec 11, 2025
37f4d54
fix: rename PostHogStackTrace
ioannisj Dec 11, 2025
7c137b2
fix: default to generic mechanism type
ioannisj Dec 11, 2025
a78f078
feat: avoid circular chains
ioannisj Dec 11, 2025
336935e
fix: format
ioannisj Dec 11, 2025
6418356
feat: base implementation
ioannisj Dec 19, 2025
81ea865
fix: minor refactor
ioannisj Dec 19, 2025
2f20d82
fix: crash report event context
ioannisj Dec 19, 2025
a470c28
feat: add in-app detection
ioannisj Dec 19, 2025
9262d1e
feat: add crash triggers to sample project
ioannisj Dec 20, 2025
5e873e3
fix: cleanup debug images
ioannisj Dec 21, 2025
75b2a49
feat: exception type order
ioannisj Dec 21, 2025
1e7a3a6
feat: add a note on fatalError
ioannisj Dec 21, 2025
e9b9d8e
feat: add comment on chained exceptions
ioannisj Dec 21, 2025
a95db65
fix: format
ioannisj Dec 22, 2025
e02cc58
feat: add unit tests
ioannisj Dec 22, 2025
b0e8fb3
fix: rename config option and integration
ioannisj Jan 30, 2026
931a5f0
Merge branch 'main' into feat/error-tracking-autocapture
ioannisj Jan 30, 2026
40b3c50
fix: format
ioannisj Jan 30, 2026
2d39504
fix: folder structure
ioannisj Jan 30, 2026
6c78106
fix:
ioannisj Jan 30, 2026
a993c53
fix: mark autoCapture unavailable on watchOS and visionOS
ioannisj Jan 30, 2026
786e3d1
fix: tvOS mach unavailable
ioannisj Jan 30, 2026
faa32f1
Merge branch 'feat/error-tracking' into feat/error-tracking-autocapture
ioannisj Jan 30, 2026
a0bcd80
fix: project
ioannisj Jan 30, 2026
8df74ba
fix: temp disable swiftlint rule
ioannisj Jan 30, 2026
ab5dcaf
fix: ci
ioannisj Jan 30, 2026
5f9f049
fix: build
ioannisj Jan 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
build:
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
build:
runs-on: macos-14-xlarge
runs-on: macos-15-xlarge
steps:
- uses: actions/checkout@v6
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions:

jobs:
test:
runs-on: macos-14
runs-on: macos-15
steps:
- uses: actions/checkout@v6
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
Expand Down
9 changes: 9 additions & 0 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let package = Package(
],
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/microsoft/plcrashreporter.git", from: "1.8.0"),
.package(url: "https://github.com/Quick/Quick.git", from: "6.0.0"),
.package(url: "https://github.com/Quick/Nimble.git", from: "12.0.0"),
.package(url: "https://github.com/AliSoftware/OHHTTPStubs.git", from: "9.0.0"),
Expand All @@ -25,7 +26,10 @@ let package = Package(
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "PostHog",
dependencies: ["phlibwebp"],
dependencies: [
"phlibwebp",
.product(name: "CrashReporter", package: "plcrashreporter", condition: .when(platforms: [.iOS, .macOS, .tvOS])),
],
path: "PostHog",
resources: [
.copy("Resources/PrivacyInfo.xcprivacy"),
Expand Down
6 changes: 6 additions & 0 deletions PostHog.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ Pod::Spec.new do |s|

s.frameworks = 'Foundation'

# PLCrashReporter dependency (not available on watchOS)
# Using ~> 1.8 for minimum compatibility with host apps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to choose this version specifically?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.8.0 is the earliest version that supports saving custom data along with the crash report (PLCrashReporter.customData), which we use to persist context at crash time so we can accurately rebuild all the event properties on subsequent app launches. So minimum version that has the features we need

s.ios.dependency 'PLCrashReporter', '~> 1.8'
s.osx.dependency 'PLCrashReporter', '~> 1.8'
s.tvos.dependency 'PLCrashReporter', '~> 1.8'

s.source_files = [
'PostHog/**/*.{swift,h,hpp,m,mm,c,cpp}',
'vendor/libwebp/**/*.{h,c}'
Expand Down
63 changes: 57 additions & 6 deletions PostHog.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions PostHog/ErrorTracking/Models/PostHogBinaryImageInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,26 @@ struct PostHogBinaryImageInfo {
let uuid: String?

/// Virtual memory address from the Mach-O headers (preferred load address)
let vmAddress: UInt64
let vmAddress: UInt64?

/// Actual load address in memory (may differ from vmAddress due to ASLR)
let address: UInt64

/// Size of the binary image in bytes
let size: UInt64

/// CPU architecture (e.g., "arm64", "x86_64")
let arch: String?

init(name: String, uuid: String?, vmAddress: UInt64?, address: UInt64, size: UInt64, arch: String? = nil) {
self.name = name
self.uuid = uuid
self.vmAddress = vmAddress
self.address = address
self.size = size
self.arch = arch
}

var toDictionary: [String: Any] {
var dict: [String: Any] = [
"type": "macho",
Expand All @@ -42,7 +54,13 @@ struct PostHogBinaryImageInfo {
dict["debug_id"] = uuid
}

dict["image_vmaddr"] = String(format: PostHogStackFrame.hexAddressFormat, vmAddress)
if let vmAddress, vmAddress > 0 {
dict["image_vmaddr"] = String(format: PostHogStackFrame.hexAddressFormat, vmAddress)
}

if let arch = arch {
dict["arch"] = arch
}

return dict
}
Expand Down
Loading
Loading