Skip to content

feat: integrate diagnostics client#337

Merged
sojingle merged 13 commits intomainfrom
diagnostics
Dec 12, 2025
Merged

feat: integrate diagnostics client#337
sojingle merged 13 commits intomainfrom
diagnostics

Conversation

@sojingle
Copy link
Copy Markdown
Collaborator

@sojingle sojingle commented Nov 18, 2025

Summary

  • Integrate diagnostics client
  • Add crash catcher

Checklist

  • Does your PR title have the correct title format?
  • Does your PR have a breaking change?: no

Note

Integrates diagnostics across the SDK, adds a NoUIKit variant, updates core dependency, and refreshes autocapture/remote-config, tests/CI, and build scripts.

  • Core/Diagnostics:
    • Wire DiagnosticsClient via Configuration and AmplitudeContext; add enableDiagnostics default and remote client initialization.
    • Emit diagnostics: set SDK version/autocapture tags; count sent/dropped events in PersistentStorageResponseHandler.
    • Add AutocaptureOptions.stringRepresentation() and track enabled autocapture via updateEnabledAutocapture from Remote Config (sessions, app lifecycles, screen/interactions, network).
  • Targets/Build:
    • Add Amplitude-Swift-NoUIKit target and Amplitude-Swift-Package-DisableUIKit scheme; enforce no UIKit linkage with shell script.
    • Conditional-import AmplitudeCore vs AmplitudeCoreNoUIKit throughout sources.
    • Update build_framework.sh to build by scheme (incl. NoUIKit).
  • Dependencies:
    • Bump AmplitudeCore-Swift to 1.3.1 (SPM and Xcode project).
  • CI:
    • Migrate workflows to macos-15, Xcode 16.4, newer OS/device matrices; ObjC example runs on iOS 18.5.
  • Network Tracking/Remote Config:
    • Apply remote network tracking config (enable/hosts/rules); stabilize tests; refine URLSession swizzling and FakeURLProtocol filtering.
  • Examples:
    • Add Diagnostics actions (Flush/Crash) to SwiftUI example; update example capture option key to allowlist.
  • Tests:
    • Add FakeDiagnosticsClient; overhaul Remote Config test harness; adjust expectations/timings and sequencing; numerous test updates to pass new interfaces.

Written by Cursor Bugbot for commit bccdc33. Configure here.

Comment thread Sources/Amplitude/Utilities/CrashCatcher.swift Outdated
@sojingle sojingle force-pushed the diagnostics branch 5 times, most recently from dff57f5 to 03d561d Compare December 9, 2025 18:29
@sojingle sojingle force-pushed the diagnostics branch 4 times, most recently from 754d0e9 to 91d5264 Compare December 10, 2025 22:34
@sojingle sojingle marked this pull request as ready for review December 11, 2025 05:15
@promptless
Copy link
Copy Markdown

promptless Bot commented Dec 11, 2025

📝 Documentation updates detected!

New suggestion: Document enableDiagnostics configuration option for iOS Swift SDK

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Comment @cursor review or bugbot run to trigger another review on this PR

Comment thread Sources/Amplitude/Utilities/PersistentStorageResponseHandler.swift Outdated
@sojingle
Copy link
Copy Markdown
Collaborator Author

bugbot run

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


Comment @cursor review or bugbot run to trigger another review on this PR

Copy link
Copy Markdown
Collaborator

@crleona crleona left a comment

Choose a reason for hiding this comment

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

Would it make sense to centralize (at least some of) the autocapture logic? it looks like you're already halfway there with the changes to report which autocapture options are enabled to diagnostics.

@sojingle sojingle force-pushed the diagnostics branch 3 times, most recently from 19ee8e6 to 4a85018 Compare December 12, 2025 18:05
@sojingle
Copy link
Copy Markdown
Collaborator Author

sojingle commented Dec 12, 2025

Would it make sense to centralize (at least some of) the autocapture logic?

@crleona sounds good. It’s a bit too scattered right now. I will submit another PR to handle this.

Currently, the UT success rate has improved a lot. There are still some issues, but it’s back within an acceptable range. Next, adding the feature to pass in the identity during init can further boost the success rate.

@sojingle sojingle merged commit 77d0411 into main Dec 12, 2025
21 of 24 checks passed
@sojingle sojingle deleted the diagnostics branch December 12, 2025 22:23
@promptless
Copy link
Copy Markdown

promptless Bot commented Dec 12, 2025

📝 Documentation updates detected!

Updated existing suggestion: Document enableDiagnostics configuration option for iOS Swift SDK

@crleona
Copy link
Copy Markdown
Collaborator

crleona commented Dec 12, 2025

Currently, the UT success rate has improved a lot. There are still some issues, but it’s back within an acceptable range. Next, adding the feature to pass in the identity during init can further boost the success rate.

nice!

github-actions Bot pushed a commit that referenced this pull request Dec 17, 2025
# [1.16.0](v1.15.5...v1.16.0) (2025-12-17)

### Bug Fixes

* centralize autpcapture logic ([#341](#341)) ([19faeaf](19faeaf))
* Incorrect implementation of the atomic wrapper ([#343](#343)) ([ecce5a4](ecce5a4))

### Features

* integrate diagnostics client ([#337](#337)) ([77d0411](77d0411))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants