Skip to content

Commit af93968

Browse files
committed
fix(networking): implement thread-safe access patterns for Swift 6 compatibility
- refactor(APIClient): add synchronized property accessors with queue.sync - fix(concurrency): ensure proper barrier flags for collection operations - refactor(StreamingSessionDelegate): implement thread-safe data buffer access - fix(SendablePromise): add queue-based synchronization for callback execution - chore(Sendable): handle @unchecked Sendable conformance properly This commit addresses potential data races detected by Thread Sanitizer and ensures compliance with Swift 6's stricter Sendable protocol requirements.
1 parent a58bdd7 commit af93968

File tree

11 files changed

+580
-321
lines changed

11 files changed

+580
-321
lines changed

Example/SRNetworkManagerExampleApp.xcodeproj/project.pbxproj

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
011108B52D109AF400B9C858 /* SRNetworkManager in Frameworks */ = {isa = PBXBuildFile; productRef = 011108B42D109AF400B9C858 /* SRNetworkManager */; };
10+
01BC1EF02D95D06000DF8431 /* SRNetworkManager in Frameworks */ = {isa = PBXBuildFile; productRef = 01BC1EEF2D95D06000DF8431 /* SRNetworkManager */; };
1111
D50FF5E02D10478B008AF330 /* SRNetworkManager in Frameworks */ = {isa = PBXBuildFile; productRef = D50FF5DF2D10478B008AF330 /* SRNetworkManager */; };
1212
/* End PBXBuildFile section */
1313

@@ -28,7 +28,7 @@
2828
isa = PBXFrameworksBuildPhase;
2929
buildActionMask = 2147483647;
3030
files = (
31-
011108B52D109AF400B9C858 /* SRNetworkManager in Frameworks */,
31+
01BC1EF02D95D06000DF8431 /* SRNetworkManager in Frameworks */,
3232
D50FF5E02D10478B008AF330 /* SRNetworkManager in Frameworks */,
3333
);
3434
runOnlyForDeploymentPostprocessing = 0;
@@ -73,7 +73,7 @@
7373
name = SRNetworkManagerExampleApp;
7474
packageProductDependencies = (
7575
D50FF5DF2D10478B008AF330 /* SRNetworkManager */,
76-
011108B42D109AF400B9C858 /* SRNetworkManager */,
76+
01BC1EEF2D95D06000DF8431 /* SRNetworkManager */,
7777
);
7878
productName = SRGenericNetworkLayerExampleApp;
7979
productReference = 017913072C9E03770011B237 /* SRNetworkManagerExampleApp.app */;
@@ -104,7 +104,7 @@
104104
mainGroup = 017912FE2C9E03770011B237;
105105
minimizedProjectReferenceProxies = 1;
106106
packageReferences = (
107-
011108B32D109AF400B9C858 /* XCRemoteSwiftPackageReference "SRNetworkManager" */,
107+
01BC1EEE2D95D06000DF8431 /* XCLocalSwiftPackageReference "../../SRGenericNetworkLayer" */,
108108
);
109109
preferredProjectObjectVersion = 77;
110110
productRefGroup = 017913082C9E03770011B237 /* Products */;
@@ -337,21 +337,16 @@
337337
};
338338
/* End XCConfigurationList section */
339339

340-
/* Begin XCRemoteSwiftPackageReference section */
341-
011108B32D109AF400B9C858 /* XCRemoteSwiftPackageReference "SRNetworkManager" */ = {
342-
isa = XCRemoteSwiftPackageReference;
343-
repositoryURL = "https://github.com/siamakrostami/SRNetworkManager";
344-
requirement = {
345-
kind = upToNextMinorVersion;
346-
minimumVersion = 1.0.17;
347-
};
340+
/* Begin XCLocalSwiftPackageReference section */
341+
01BC1EEE2D95D06000DF8431 /* XCLocalSwiftPackageReference "../../SRGenericNetworkLayer" */ = {
342+
isa = XCLocalSwiftPackageReference;
343+
relativePath = ../../SRGenericNetworkLayer;
348344
};
349-
/* End XCRemoteSwiftPackageReference section */
345+
/* End XCLocalSwiftPackageReference section */
350346

351347
/* Begin XCSwiftPackageProductDependency section */
352-
011108B42D109AF400B9C858 /* SRNetworkManager */ = {
348+
01BC1EEF2D95D06000DF8431 /* SRNetworkManager */ = {
353349
isa = XCSwiftPackageProductDependency;
354-
package = 011108B32D109AF400B9C858 /* XCRemoteSwiftPackageReference "SRNetworkManager" */;
355350
productName = SRNetworkManager;
356351
};
357352
D50FF5DF2D10478B008AF330 /* SRNetworkManager */ = {

Example/SRNetworkManagerExampleApp.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1620"
4+
version = "1.7">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES"
8+
buildArchitectures = "Automatic">
9+
<BuildActionEntries>
10+
<BuildActionEntry
11+
buildForTesting = "YES"
12+
buildForRunning = "YES"
13+
buildForProfiling = "YES"
14+
buildForArchiving = "YES"
15+
buildForAnalyzing = "YES">
16+
<BuildableReference
17+
BuildableIdentifier = "primary"
18+
BlueprintIdentifier = "017913062C9E03770011B237"
19+
BuildableName = "SRNetworkManagerExampleApp.app"
20+
BlueprintName = "SRNetworkManagerExampleApp"
21+
ReferencedContainer = "container:SRNetworkManagerExampleApp.xcodeproj">
22+
</BuildableReference>
23+
</BuildActionEntry>
24+
</BuildActionEntries>
25+
</BuildAction>
26+
<TestAction
27+
buildConfiguration = "Debug"
28+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
29+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
30+
shouldUseLaunchSchemeArgsEnv = "YES"
31+
shouldAutocreateTestPlan = "YES">
32+
</TestAction>
33+
<LaunchAction
34+
buildConfiguration = "Debug"
35+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
36+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
37+
enableThreadSanitizer = "YES"
38+
launchStyle = "0"
39+
useCustomWorkingDirectory = "NO"
40+
ignoresPersistentStateOnLaunch = "NO"
41+
debugDocumentVersioning = "YES"
42+
debugServiceExtension = "internal"
43+
allowLocationSimulation = "YES">
44+
<BuildableProductRunnable
45+
runnableDebuggingMode = "0">
46+
<BuildableReference
47+
BuildableIdentifier = "primary"
48+
BlueprintIdentifier = "017913062C9E03770011B237"
49+
BuildableName = "SRNetworkManagerExampleApp.app"
50+
BlueprintName = "SRNetworkManagerExampleApp"
51+
ReferencedContainer = "container:SRNetworkManagerExampleApp.xcodeproj">
52+
</BuildableReference>
53+
</BuildableProductRunnable>
54+
</LaunchAction>
55+
<ProfileAction
56+
buildConfiguration = "Release"
57+
shouldUseLaunchSchemeArgsEnv = "YES"
58+
savedToolIdentifier = ""
59+
useCustomWorkingDirectory = "NO"
60+
debugDocumentVersioning = "YES">
61+
<BuildableProductRunnable
62+
runnableDebuggingMode = "0">
63+
<BuildableReference
64+
BuildableIdentifier = "primary"
65+
BlueprintIdentifier = "017913062C9E03770011B237"
66+
BuildableName = "SRNetworkManagerExampleApp.app"
67+
BlueprintName = "SRNetworkManagerExampleApp"
68+
ReferencedContainer = "container:SRNetworkManagerExampleApp.xcodeproj">
69+
</BuildableReference>
70+
</BuildableProductRunnable>
71+
</ProfileAction>
72+
<AnalyzeAction
73+
buildConfiguration = "Debug">
74+
</AnalyzeAction>
75+
<ArchiveAction
76+
buildConfiguration = "Release"
77+
revealArchiveInOrganizer = "YES">
78+
</ArchiveAction>
79+
</Scheme>

0 commit comments

Comments
 (0)