From 0627fd349a58f686c25628a1e912865d33685e29 Mon Sep 17 00:00:00 2001 From: Archish Date: Fri, 4 Sep 2026 11:25:24 +0530 Subject: [PATCH 1/2] chore: :art: removed legacy recorder v2 --- README.md | 6 ++-- android/build.gradle | 2 +- .../ConfigMapReader.java | 4 --- .../MiddlewareReactNativeModule.java | 3 -- ios/MiddlewareReactNative.swift | 3 -- middleware-react-native.podspec | 2 +- package.json | 2 +- src/middlewareRum.ts | 30 +++---------------- src/native.ts | 1 - 9 files changed, 9 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index 3bdc76f..3d47d25 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ Middleware React Native Real User Monitoring SDK Middleware React Native for Mobile supports React Native 0.68 and higher. Since v2.0.0 the SDK wraps the stable Middleware native SDKs -(`io.github.middleware-labs:android-sdk` 3.0.2+ and the `MiddlewareRum` -CocoaPod 2.1+), which brings v3 session recording (rrweb replay), native +(`io.github.middleware-labs:android-sdk` 3.1.4+ and the `MiddlewareRum` +CocoaPod 2.2.2+), which brings v3 session recording (rrweb replay), native crash/ANR reporting, and screen-name linked replays. Native toolchain requirements: @@ -308,8 +308,6 @@ const MiddlewareConfig: ReactNativeConfiguration = { }, // Fraction of sessions that get recorded (0.0 - 1.0). Defaults to 1.0. sessionSamplingRatio: 1.0, - // Fall back to the legacy (v2) screenshot recorder. v3 (rrweb replay) is the default. - disableSessionRecordingV3: false, }; ``` diff --git a/android/build.gradle b/android/build.gradle index 69c8e2a..d5c99c8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -83,7 +83,7 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // Stable native SDK (main branch). 3.1.0 adds startRecording/stopRecording/isRecording. - implementation 'io.github.middleware-labs:android-sdk:3.1.2' + implementation 'io.github.middleware-labs:android-sdk:3.1.4' coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:2.0.4" // Compile-visible OTel for the JS-span reconstruction (SpanData etc.); // runtime classes come transitively from android-sdk. Keep aligned with diff --git a/android/src/main/java/com/middlewarereactnative/ConfigMapReader.java b/android/src/main/java/com/middlewarereactnative/ConfigMapReader.java index aa5d543..4c7c15a 100644 --- a/android/src/main/java/com/middlewarereactnative/ConfigMapReader.java +++ b/android/src/main/java/com/middlewarereactnative/ConfigMapReader.java @@ -48,10 +48,6 @@ public ReadableMap getRecordingOptions() { return Keys.RECORDING_OPTIONS.getMap(map); } - public boolean getDisableSessionRecordingV3() { - return map.hasKey("disableSessionRecordingV3") && map.getBoolean("disableSessionRecordingV3"); - } - public Double getSessionSamplingRatio() { return map.hasKey("sessionSamplingRatio") ? map.getDouble("sessionSamplingRatio") : null; } diff --git a/android/src/main/java/com/middlewarereactnative/MiddlewareReactNativeModule.java b/android/src/main/java/com/middlewarereactnative/MiddlewareReactNativeModule.java index 5a0f982..6a9930a 100644 --- a/android/src/main/java/com/middlewarereactnative/MiddlewareReactNativeModule.java +++ b/android/src/main/java/com/middlewarereactnative/MiddlewareReactNativeModule.java @@ -112,9 +112,6 @@ public void initialize(ReadableMap configMap, Promise promise) { if (!Boolean.TRUE.toString().equals(sessionRecording)) { builder.disableSessionRecording(); } - if (mapReader.getDisableSessionRecordingV3()) { - builder.disableSessionRecordingV3(); - } final Double samplingRatio = mapReader.getSessionSamplingRatio(); if (samplingRatio != null) { builder.setSessionSamplingRatio(samplingRatio); diff --git a/ios/MiddlewareReactNative.swift b/ios/MiddlewareReactNative.swift index 5a4ace8..316f5bf 100644 --- a/ios/MiddlewareReactNative.swift +++ b/ios/MiddlewareReactNative.swift @@ -56,9 +56,6 @@ class MiddlewareReactNative: NSObject { if (config["sessionRecording"] as? String) != "true" { _ = builder.disableRecording() } - if config["disableSessionRecordingV3"] as? Bool == true { - _ = builder.disableSessionRecordingV3() - } if let recordingOptions = config["recordingOptions"] as? [String: Any] { _ = builder.recordingOptions(mapRecordingOptions(recordingOptions)) } diff --git a/middleware-react-native.podspec b/middleware-react-native.podspec index 78be5d6..190b766 100644 --- a/middleware-react-native.podspec +++ b/middleware-react-native.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| # Stable native SDK (2.1+ adds setNativeSession + exportRawSpans); brings # PLCrashReporter/DeviceKit/SwiftProtobuf/SWCompression/Reachability transitively. - s.dependency "MiddlewareRum", "~> 2.2" + s.dependency "MiddlewareRum", "~> 2.2.2" # React dependencies. `install_modules_dependencies` (react_native_pods.rb, # RN >= 0.71) wires the right pods for whichever architecture the host app diff --git a/package.json b/package.json index 04a1e9c..a5ae227 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@middleware.io/middleware-react-native", - "version": "2.1.5", + "version": "2.1.6", "description": "Middleware React Native real user monitoring SDK", "main": "lib/commonjs/index", "module": "lib/module/index", diff --git a/src/middlewareRum.ts b/src/middlewareRum.ts index 79c170c..3bbd461 100644 --- a/src/middlewareRum.ts +++ b/src/middlewareRum.ts @@ -69,10 +69,8 @@ export interface ReactNativeConfiguration { serviceName: string; projectName: string; sessionRecording?: boolean; - /** Options for v3 session recording (rrweb screenshot events). */ + /** Options for session recording (rrweb screenshot events). */ recordingOptions?: RecordingOptions; - /** Falls back to the legacy (v2) screenshot recorder when true. */ - disableSessionRecordingV3?: boolean; /** Fraction of sessions to sample for traces + recordings, 0.0–1.0. */ sessionSamplingRatio?: number; deploymentEnvironment?: string; @@ -163,11 +161,10 @@ let appStartInfo: AppStartInfo | null = null; let isInitialized = false; // Live recording state, mirrored onto the provider resource so exported spans -// always carry the current `recording`/`recordingV3` values. Recording can be -// toggled at runtime, and these attributes are what tell the backend a session -// has a replay to play back. +// always carry the current `recording` value. Recording can be toggled at +// runtime, and this attribute is what tells the backend a session has a replay +// to play back. let isRecordingActive = false; -let isRecordingV3Configured = true; const updateLocation = (latitude: number, longitude: number) => { setGlobalAttributes({ @@ -249,22 +246,14 @@ export const MiddlewareRum: MiddlewareRumType = { } isRecordingActive = sessionRecording === 'true'; - isRecordingV3Configured = !config.disableSessionRecordingV3; const recordingAttr = sessionRecording === 'true' ? '1' : '0'; - // recordingV3 routes bifrost to the rrweb player; matches the native - // SDKs' resource attribute (v3 is on by default when recording is on). - const recordingV3Attr = - sessionRecording === 'true' && !config.disableSessionRecordingV3 - ? '1' - : '0'; const resourceAttributes = { ...getResource(), [SemanticResourceAttributes.SERVICE_NAME]: config.serviceName, 'project.name': config.projectName, 'env': config.deploymentEnvironment, 'recording': recordingAttr, - 'recordingV3': recordingV3Attr, 'session.id': getSessionId(), 'session.start_time': getSessionStartTime(), }; @@ -283,9 +272,6 @@ export const MiddlewareRum: MiddlewareRumType = { ...(config.sessionSamplingRatio !== undefined && { sessionSamplingRatio: config.sessionSamplingRatio, }), - ...(config.disableSessionRecordingV3 !== undefined && { - disableSessionRecordingV3: config.disableSessionRecordingV3, - }), ...(config.recordingOptions !== undefined && { recordingOptions: config.recordingOptions, }), @@ -326,14 +312,6 @@ export const MiddlewareRum: MiddlewareRumType = { enumerable: true, }); - Object.defineProperty(provider.resource.attributes, 'recordingV3', { - get() { - return isRecordingActive && isRecordingV3Configured ? '1' : '0'; - }, - configurable: true, - enumerable: true, - }); - // The OTLP options are only used if the native module is missing; on a // normal build the native SDK still owns the pipeline. provider.addSpanProcessor( diff --git a/src/native.ts b/src/native.ts index 2b08e4b..c0c4931 100644 --- a/src/native.ts +++ b/src/native.ts @@ -91,7 +91,6 @@ export interface NativeSdKConfiguration { projectName: string; deploymentEnvironment?: string; sessionSamplingRatio?: number; - disableSessionRecordingV3?: boolean; recordingOptions?: { frequency?: string; quality?: string; From 33f75886713bf7b930addcd666b07bf7706fae48 Mon Sep 17 00:00:00 2001 From: Archish Date: Fri, 4 Sep 2026 11:32:04 +0530 Subject: [PATCH 2/2] chore: updated pod lock --- example/ios/Podfile.lock | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index d5026ae..6e998be 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -13,10 +13,12 @@ PODS: - ReactCommon/turbomodule/core (= 0.73.1) - fmt (6.2.1) - glog (0.3.5) - - middleware-react-native (2.1.0): - - MiddlewareRum (~> 2.2) + - middleware-react-native (2.1.6): + - glog + - MiddlewareRum (~> 2.2.2) + - RCT-Folly (= 2022.05.16.00) - React-Core - - MiddlewareRum (2.2.0): + - MiddlewareRum (2.2.2): - DeviceKit (~> 5.4) - PLCrashReporter (~> 1.11) - Reachability (~> 3.7) @@ -1264,8 +1266,8 @@ SPEC CHECKSUMS: FBReactNativeSpec: df0ebe69acd14ce0be0269cf75b6e338a727259b fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 - middleware-react-native: 6052a2e9035f41589a46a89e742c09f2af1511e4 - MiddlewareRum: 898c83793cc710d68d8b124d6a9e1be1095153a4 + middleware-react-native: f075d12bae4af81059b646ae2c2be033de2ac42b + MiddlewareRum: c7287f0a65cbe83a043ae5d0f433d6563b74fab8 PLCrashReporter: db59ef96fa3d25f3650040d02ec2798cffee75f2 RCT-Folly: cd21f1661364f975ae76b3308167ad66b09f53f5 RCTRequired: 6dda55e483f75d2b43781d8ad5bd7df276a50981 @@ -1317,6 +1319,6 @@ SPEC CHECKSUMS: SwiftProtobuf: b109bd17979d7993a84da14b1e1fdd8b0ded934a Yoga: 4f53dc50008d626fa679c7a1cb4bed898f8c0bde -PODFILE CHECKSUM: a820c5f655f7733be8c7de79270e7241d08295e7 +PODFILE CHECKSUM: 4d5c450dd208d07f681cab2179a482c80dd4cb07 COCOAPODS: 1.17.0