dd-sdk-ios icon indicating copy to clipboard operation
dd-sdk-ios copied to clipboard

Fix Session Replay ObjC interface

Open mariedm opened this issue 1 year ago • 1 comments

What and why?

The current Objective-C interface for Session Replay doesn't adhere to the internal guidelines for Objective-C interoperability (see RFC).

How?

  • Applied @_spi(objc) to hide the ObjC interfaces from Swift consumers while keeping them accessible to ObjC clients.
  • Prefixed types with objc_* to differentiate them from Swift-native types.
  • Updated the ObjC interface for SessionReplay, SessionReplayConfiguration, and the different privacy levels following the modular interface guidelines.
  • Moved DDSessionReplayTests to the Session Replay module

Review checklist

  • [x] Feature or bugfix MUST have appropriate tests (unit, integration)
  • [ ] Make sure each commit and the PR mention the Issue number or JIRA reference
  • [ ] Add CHANGELOG entry for user facing changes

mariedm avatar Oct 04 '24 12:10 mariedm

Datadog Report

Branch report: fix-sr-objc-interface Commit report: ce213b9 Test service: dd-sdk-ios

:white_check_mark: 0 Failed, 3479 Passed, 0 Skipped, 2m 21.39s Total Time :small_red_triangle_down: Test Sessions change in coverage: 5 decreased, 4 increased, 5 no change

:small_red_triangle_down: Code Coverage Decreases vs Default Branch (5)

  • test DatadogCoreTests iOS 72.58% (-0.16%) - Details
  • test DatadogTraceTests tvOS 54.29% (-0.04%) - Details
  • test DatadogInternalTests iOS 79.47% (-0.04%) - Details
  • test DatadogRUMTests iOS 81.08% (-0.03%) - Details
  • test DatadogTraceTests iOS 54.25% (-0.02%) - Details

Is the following a potentially backward-incompatible change?

Prefixed types with objc_* to differentiate them from Swift-native types.

It is changing the name of the exported symbols, right?

0xnm avatar Oct 07 '24 08:10 0xnm

Is the following a potentially backward-incompatible change?

Prefixed types with objc_* to differentiate them from Swift-native types.

It is changing the name of the exported symbols, right?

This won't cause any backward compatibility issues. ObjC users will still use DDSessionReplay and and DDSessionReplayConfiguration thanks to the @objc(xxx) annotation. The exported symbols will stay the same.

mariedm avatar Oct 07 '24 14:10 mariedm