Skip to content

Commit b50dafd

Browse files
authored
Merge branch 'develop' into NR-502468
2 parents fc77bcd + 6e33ecf commit b50dafd

30 files changed

+1221
-194
lines changed

Agent.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6714,7 +6714,7 @@
67146714
"$(SRCROOT)/modular-crash-reporter-ios/Source/Tests/**",
67156715
);
67166716
INFOPLIST_FILE = "Tests/Unit-Tests/Shared/tests-Info.plist";
6717-
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
6717+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
67186718
LD_RUNPATH_SEARCH_PATHS = (
67196719
"$(inherited)",
67206720
"@executable_path/Frameworks",
@@ -6763,7 +6763,7 @@
67636763
"$(SRCROOT)/modular-crash-reporter-ios/Source/Tests/**",
67646764
);
67656765
INFOPLIST_FILE = "Tests/Unit-Tests/Shared/tests-Info.plist";
6766-
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
6766+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
67676767
LD_RUNPATH_SEARCH_PATHS = (
67686768
"$(inherited)",
67696769
"@executable_path/Frameworks",
@@ -6977,7 +6977,7 @@
69776977
);
69786978
INFOPLIST_FILE = Agent/Info.plist;
69796979
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
6980-
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
6980+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
69816981
LD_RUNPATH_SEARCH_PATHS = (
69826982
"$(inherited)",
69836983
"@executable_path/Frameworks",
@@ -6995,7 +6995,7 @@
69956995
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
69966996
SWIFT_VERSION = 5.0;
69976997
TARGETED_DEVICE_FAMILY = "1,2";
6998-
TVOS_DEPLOYMENT_TARGET = 16.6;
6998+
TVOS_DEPLOYMENT_TARGET = 15.0;
69996999
WATCHOS_DEPLOYMENT_TARGET = 8.7;
70007000
};
70017001
name = Debug;
@@ -7034,7 +7034,7 @@
70347034
);
70357035
INFOPLIST_FILE = Agent/Info.plist;
70367036
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
7037-
IPHONEOS_DEPLOYMENT_TARGET = 16.6;
7037+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
70387038
LD_RUNPATH_SEARCH_PATHS = (
70397039
"$(inherited)",
70407040
"@executable_path/Frameworks",
@@ -7051,7 +7051,7 @@
70517051
STRIP_STYLE = "non-global";
70527052
SWIFT_VERSION = 5.0;
70537053
TARGETED_DEVICE_FAMILY = "1,2";
7054-
TVOS_DEPLOYMENT_TARGET = 16.6;
7054+
TVOS_DEPLOYMENT_TARGET = 15.0;
70557055
WATCHOS_DEPLOYMENT_TARGET = 8.7;
70567056
};
70577057
name = Release;
@@ -7299,7 +7299,7 @@
72997299
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
73007300
SWIFT_VERSION = 5.0;
73017301
TARGETED_DEVICE_FAMILY = 3;
7302-
TVOS_DEPLOYMENT_TARGET = 16.6;
7302+
TVOS_DEPLOYMENT_TARGET = 15.0;
73037303
WATCHOS_DEPLOYMENT_TARGET = 8.7;
73047304
};
73057305
name = Debug;
@@ -7350,7 +7350,7 @@
73507350
SUPPORTED_PLATFORMS = "appletvsimulator appletvos";
73517351
SWIFT_VERSION = 5.0;
73527352
TARGETED_DEVICE_FAMILY = 3;
7353-
TVOS_DEPLOYMENT_TARGET = 16.6;
7353+
TVOS_DEPLOYMENT_TARGET = 15.0;
73547354
WATCHOS_DEPLOYMENT_TARGET = 8.7;
73557355
};
73567356
name = Release;

Agent/Network/NRMAHTTPUtilities.mm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ + (NSArray*) trackedHeaderFields
5454
}
5555

5656
+ (NSMutableURLRequest*) addCrossProcessIdentifier:(NSURLRequest*)request {
57-
5857
NSMutableURLRequest* mutableRequest = [self makeMutable:request];
59-
60-
NSString* xprocess = [NRMAHarvestController configuration].cross_process_id;
61-
58+
NRMAHarvesterConfiguration *config = [NRMAHarvestController configuration];
59+
60+
if (!config) {
61+
return mutableRequest;
62+
}
63+
64+
NSString* xprocess = config.cross_process_id;
6265
if (xprocess.length) {
6366
[mutableRequest setValue:xprocess
6467
forHTTPHeaderField:NEW_RELIC_CROSS_PROCESS_ID_HEADER_KEY];

Agent/SessionReplay/NRMASessionReplay.swift

Lines changed: 114 additions & 102 deletions
Large diffs are not rendered by default.

Agent/SessionReplay/SessionReplayCapture.swift

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,23 @@ class SessionReplayCapture {
7979

8080
let context = SwiftUIContext(frame: parentThingy.viewDetails.frame, clip: parentThingy.viewDetails.clip)
8181
let thingys = UIHostingViewRecordOrchestrator.swiftUIViewThingys(currentView, context: context, viewAttributes: viewAttributes, parentId: parentThingy.viewDetails.viewId)
82-
82+
8383
if !thingys.isEmpty {
84-
parentThingy.subviews.append(contentsOf: thingys)
84+
// Separate color views (backgrounds) from other views
85+
var colorViews: [any SessionReplayViewThingy] = []
86+
var otherViews: [any SessionReplayViewThingy] = []
87+
88+
for thingy in thingys {
89+
if thingy.viewDetails.viewName == "SwiftUIColorView" {
90+
colorViews.append(thingy)
91+
} else {
92+
otherViews.append(thingy)
93+
}
94+
}
95+
96+
// Insert color views first (they go to the back) then other views
97+
parentThingy.subviews.insert(contentsOf: colorViews, at: 0)
98+
parentThingy.subviews.append(contentsOf: otherViews)
8599
}
86100
}
87101

Agent/SessionReplay/SessionReplayFrameProcessor.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SessionReplayFrameProcessor {
1515
var takeFullSnapshotNext = true
1616

1717

18-
func processFrame(_ frame: SessionReplayFrame) -> RRWebEventCommon {
18+
func processFrame(_ frame: SessionReplayFrame) -> RRWebEventCommon? {
1919
guard useIncrementalDiffs else { // If useIncrementalDiffs is false, we only take full snapshots
2020
self.lastFullFrame = frame
2121
return processFullSnapshot(frame)
@@ -28,7 +28,7 @@ class SessionReplayFrameProcessor {
2828
return processFullSnapshot(frame)
2929
}
3030

31-
var rrwebCommon: any RRWebEventCommon
31+
var rrwebCommon: (any RRWebEventCommon)?
3232
// If a full snapshot is needed, frame size changed, or UILayoutContainerView count increased
3333
if takeFullSnapshotNext || frame.size != lastFullFrame.size || (frame.layoutContainerViewCount > 1 && frame.layoutContainerViewCount > lastFullFrame.layoutContainerViewCount) {
3434
rrwebCommon = processFullSnapshot(frame)
@@ -117,7 +117,7 @@ class SessionReplayFrameProcessor {
117117
}
118118

119119

120-
private func processIncrementalSnapshot(newFrame: SessionReplayFrame, oldFrame: SessionReplayFrame) -> any RRWebEventCommon {
120+
private func processIncrementalSnapshot(newFrame: SessionReplayFrame, oldFrame: SessionReplayFrame) -> (any RRWebEventCommon)? {
121121
// Validate input parameters
122122
guard newFrame.date >= oldFrame.date else {
123123
// If frames are out of order, fall back to full snapshot
@@ -157,6 +157,11 @@ class SessionReplayFrameProcessor {
157157
}
158158

159159
let incrementalUpdate: RRWebIncrementalData = .mutation(RRWebMutationData(adds: adds, removes: removes, texts: texts, attributes: attributes))
160+
161+
if adds.isEmpty && removes.isEmpty && texts.isEmpty && attributes.isEmpty {
162+
return nil
163+
}
164+
160165
let incrementalEvent = IncrementalEvent(timestamp: (newFrame.date.timeIntervalSince1970 * 1000).rounded(), data: incrementalUpdate)
161166
return incrementalEvent
162167

0 commit comments

Comments
 (0)