Skip to content

Commit 2090b6d

Browse files
authored
Fix APM libraries crash (when present) by centralizing HTTPSession cleanup (#221)
1 parent 9ed938b commit 2090b6d

File tree

6 files changed

+17
-20
lines changed

6 files changed

+17
-20
lines changed

.pubnub.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
22
name: swift
33
scm: github.com/pubnub/swift
4-
version: "9.3.2"
4+
version: "9.3.3"
55
schema: 1
66
changelog:
7+
- date: 2025-08-07
8+
version: 9.3.3
9+
changes:
10+
- type: bug
11+
text: "APM libraries crash fix: Removed `deinit` methods that were calling `session.invalidateAndCancel()` from `PresenceEffectFactory` and `SubscribeEffectFactory` to prevent race conditions with Application Performance Monitoring libraries. Session cleanup now happens exclusively in [HTTPSession.deinit](https://github.com/pubnub/swift/blob/9.3.2/Sources/PubNub/Networking/HTTPSession.swift#L96-L99), which ensures request cancellation before invalidation. This prevents crashes from occurring inside APM libraries when they intercept network operations during session invalidation."
712
- date: 2025-08-06
813
version: 9.3.2
914
changes:
@@ -718,7 +723,7 @@ sdks:
718723
- distribution-type: source
719724
distribution-repository: GitHub release
720725
package-name: PubNub
721-
location: https://github.com/pubnub/swift/archive/refs/tags/9.3.2.zip
726+
location: https://github.com/pubnub/swift/archive/refs/tags/9.3.3.zip
722727
supported-platforms:
723728
supported-operating-systems:
724729
macOS:

PubNub.xcodeproj/project.pbxproj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4035,7 +4035,7 @@
40354035
"@loader_path/Frameworks",
40364036
);
40374037
MACOSX_DEPLOYMENT_TARGET = 10.15;
4038-
MARKETING_VERSION = 9.3.2;
4038+
MARKETING_VERSION = 9.3.3;
40394039
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
40404040
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
40414041
MTL_FAST_MATH = YES;
@@ -4086,7 +4086,7 @@
40864086
"@loader_path/Frameworks",
40874087
);
40884088
MACOSX_DEPLOYMENT_TARGET = 10.15;
4089-
MARKETING_VERSION = 9.3.2;
4089+
MARKETING_VERSION = 9.3.3;
40904090
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
40914091
MTL_ENABLE_DEBUG_INFO = NO;
40924092
MTL_FAST_MATH = YES;
@@ -4194,7 +4194,7 @@
41944194
"@loader_path/Frameworks",
41954195
);
41964196
MACOSX_DEPLOYMENT_TARGET = 10.15;
4197-
MARKETING_VERSION = 9.3.2;
4197+
MARKETING_VERSION = 9.3.3;
41984198
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
41994199
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
42004200
MTL_FAST_MATH = YES;
@@ -4247,7 +4247,7 @@
42474247
"@loader_path/Frameworks",
42484248
);
42494249
MACOSX_DEPLOYMENT_TARGET = 10.15;
4250-
MARKETING_VERSION = 9.3.2;
4250+
MARKETING_VERSION = 9.3.3;
42514251
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
42524252
MTL_ENABLE_DEBUG_INFO = NO;
42534253
MTL_FAST_MATH = YES;
@@ -4368,7 +4368,7 @@
43684368
"@loader_path/Frameworks",
43694369
);
43704370
MACOSX_DEPLOYMENT_TARGET = 10.15;
4371-
MARKETING_VERSION = 9.3.2;
4371+
MARKETING_VERSION = 9.3.3;
43724372
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
43734373
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
43744374
MTL_FAST_MATH = YES;
@@ -4420,7 +4420,7 @@
44204420
"@loader_path/Frameworks",
44214421
);
44224422
MACOSX_DEPLOYMENT_TARGET = 10.15;
4423-
MARKETING_VERSION = 9.3.2;
4423+
MARKETING_VERSION = 9.3.3;
44244424
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu11 gnu++17";
44254425
MTL_ENABLE_DEBUG_INFO = NO;
44264426
MTL_FAST_MATH = YES;
@@ -4900,7 +4900,7 @@
49004900
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
49014901
);
49024902
MACOSX_DEPLOYMENT_TARGET = 10.15;
4903-
MARKETING_VERSION = 9.3.2;
4903+
MARKETING_VERSION = 9.3.3;
49044904
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++14";
49054905
OTHER_CFLAGS = "$(inherited)";
49064906
OTHER_LDFLAGS = "$(inherited)";
@@ -4943,7 +4943,7 @@
49434943
"$(TOOLCHAIN_DIR)/usr/lib/swift/macosx",
49444944
);
49454945
MACOSX_DEPLOYMENT_TARGET = 10.15;
4946-
MARKETING_VERSION = 9.3.2;
4946+
MARKETING_VERSION = 9.3.3;
49474947
MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++14";
49484948
OTHER_CFLAGS = "$(inherited)";
49494949
OTHER_LDFLAGS = "$(inherited)";

PubNubSwift.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'PubNubSwift'
3-
s.version = '9.3.2'
3+
s.version = '9.3.3'
44
s.homepage = 'https://github.com/pubnub/swift'
55
s.documentation_url = 'https://www.pubnub.com/docs/swift-native/pubnub-swift-sdk'
66
s.authors = { 'PubNub, Inc.' => '[email protected]' }

Sources/PubNub/EventEngine/Presence/Effects/PresenceEffectFactory.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,4 @@ class PresenceEffectFactory: EffectHandlerFactory {
5555
return WaitEffect(configuration: dependencies.value.configuration)
5656
}
5757
}
58-
59-
deinit {
60-
session.invalidateAndCancel()
61-
}
6258
}

Sources/PubNub/EventEngine/Subscribe/Effects/SubscribeEffectFactory.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,4 @@ class SubscribeEffectFactory: EffectHandlerFactory {
7272
)
7373
}
7474
}
75-
76-
deinit {
77-
session.invalidateAndCancel()
78-
}
7975
}

Sources/PubNub/Helpers/Constants.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public enum Constant {
5757

5858
static let pubnubSwiftSDKName: String = "PubNubSwift"
5959

60-
static let pubnubSwiftSDKVersion: String = "9.3.2"
60+
static let pubnubSwiftSDKVersion: String = "9.3.3"
6161

6262
static let appBundleId: String = {
6363
if let info = Bundle.main.infoDictionary,

0 commit comments

Comments
 (0)