Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APP-5893: Changed shadowing issue and added dependency of NaimKit. #13

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions Projects/SSEKit/SSEKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
12EC047E2731990700FA5116 /* NaimKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12EC047D2731990700FA5116 /* NaimKit.framework */; };
12EC047F2731990700FA5116 /* NaimKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 12EC047D2731990700FA5116 /* NaimKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
2A18FBC41C7CB8A80052DFCE /* EventSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A18FBC31C7CB8A80052DFCE /* EventSource.swift */; };
2A18FBC61C7CB8C40052DFCE /* EventSourceConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A18FBC51C7CB8C40052DFCE /* EventSourceConfiguration.swift */; };
2A18FBC81C7CB8EF0052DFCE /* SSEManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A18FBC71C7CB8EF0052DFCE /* SSEManager.swift */; };
Expand All @@ -29,7 +31,22 @@
};
/* End PBXContainerItemProxy section */

/* Begin PBXCopyFilesBuildPhase section */
12EC04802731990700FA5116 /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
12EC047F2731990700FA5116 /* NaimKit.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
12EC047D2731990700FA5116 /* NaimKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = NaimKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
2A18FBC31C7CB8A80052DFCE /* EventSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventSource.swift; sourceTree = "<group>"; };
2A18FBC51C7CB8C40052DFCE /* EventSourceConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EventSourceConfiguration.swift; sourceTree = "<group>"; };
2A18FBC71C7CB8EF0052DFCE /* SSEManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSEManager.swift; sourceTree = "<group>"; };
Expand All @@ -48,6 +65,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
12EC047E2731990700FA5116 /* NaimKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -69,12 +87,21 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
12EC047C2731990700FA5116 /* Frameworks */ = {
isa = PBXGroup;
children = (
12EC047D2731990700FA5116 /* NaimKit.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
2AA0D2261C7C9A3B006E83D0 = {
isa = PBXGroup;
children = (
2AA0D2321C7C9A3B006E83D0 /* SSEKit */,
2AA0D23E1C7C9A3B006E83D0 /* SSEKitTests */,
2AA0D2311C7C9A3B006E83D0 /* Products */,
12EC047C2731990700FA5116 /* Frameworks */,
);
sourceTree = "<group>";
};
Expand Down Expand Up @@ -140,6 +167,7 @@
2AA0D22C1C7C9A3B006E83D0 /* Frameworks */,
2AA0D22D1C7C9A3B006E83D0 /* Headers */,
2AA0D22E1C7C9A3B006E83D0 /* Resources */,
12EC04802731990700FA5116 /* Embed Frameworks */,
);
buildRules = (
);
Expand Down
10 changes: 5 additions & 5 deletions Projects/SSEKit/SSEKit/SSEManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,12 @@ extension SSEManager: URLSessionDataDelegate {
eventId = scan(scanner, field:"id")
var logger = Logger(subsystem: "SSEKit", category: "SSEManager", ipAddress: self.connectionURL?.host)

guard let eventId = eventId else { // finished
guard let unwrappedEventId = eventId else { // finished
logger.error("No id!")
return
}

logger = logger.with(properties: ["eventId" : eventId])
logger = logger.with(properties: ["eventId" : unwrappedEventId])

let loc = scanner.scanLocation
eventName = scan(scanner, field:"event")
Expand All @@ -368,12 +368,12 @@ extension SSEManager: URLSessionDataDelegate {

eventData = scan(scanner, field:"data")

guard let eventData = eventData else { // finished
guard let unwrappedEventData = eventData else { // finished
logger.error("No event data!")
return
}

logger = logger.with(properties: ["eventData" : eventData])
logger = logger.with(properties: ["eventData" : unwrappedEventData])

// SSE EVENT LOGGING
// On if empty set, or specific event matches name
Expand All @@ -385,7 +385,7 @@ extension SSEManager: URLSessionDataDelegate {
for eventSource in self.eventSources {
self.queue.async {

if let event = Event(withEventSource: eventSource, identifier: eventId, event: eventName ?? "", data: eventData.data(using: String.Encoding.utf8)) {
if let event = Event(withEventSource: eventSource, identifier: unwrappedEventId, event: eventName ?? "", data: unwrappedEventData.data(using: String.Encoding.utf8)) {
eventSource.handleEvent(event)
}
}
Expand Down