Enable transport-level retry for subscribe and retry related adjustments#470
Merged
Enable transport-level retry for subscribe and retry related adjustments#470
Conversation
Fix `PNRequestRetryConfiguration` `copyWithZone:` not copying `excludedEndpoints`, causing all endpoint groups to become eligible for retry after `PNConfiguration` copy. fix(subscribe): enable transport-level retry Remove hardcoded `retriable = NO` from `PNSubscribeRequest` so transport-level retry configuration is applied to subscribe long-poll requests. fix(subscribe): prevent duplicate subscribe loops Add `subscribeCycleGeneration` counter to `PNSubscriber` to detect and discard stale continuation calls dispatched asynchronously before a new subscribe cycle started. refactor(file-sharing): prevent retry of file upload requests Add `retriable = NO` to `PNFileUploadRequest` because body streams cannot be rewound after a partial send. refactor(presence): prevent retry of heartbeat requests Add `request` method override with `retriable = NO` to `PNPresenceHeartbeatRequest` because presence heartbeat has its own timer-based periodic mechanism. refactor(subscribe): remove reachability ping module Delete `PNReachability` class and remove references from `PubNub.podspec` and Framework project in favor of transport-level retry for network recovery. BREAKING CHANGE: Automatic reconnection after prolonged network outage removed; applications must handle `PNUnexpectedDisconnectCategory` and re-subscribe manually. build(spm): use custom modulemap and header search paths for SPM compatibility Update export script to generate a directory umbrella modulemap instead of flat header symlinks. Configure publicHeadersPath and cSettings in Package.swift. test(retry-policy): add retry configuration tests Add unit tests for `copyWithZone:` preserving excluded endpoints, default configuration retrying only subscribe, and heartbeat / file upload requests not being retriable. test(subscribe): add generation counter and retry tests Add unit tests verifying generation counter prevents stale subscribe continuations and transport-level retry works for subscribe requests using `NSURLProtocol` interception.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
jguz-pubnub
reviewed
Mar 20, 2026
PubNub/Data/Managers/PNSubscriber.m
Outdated
Comment on lines
+1123
to
+1124
| NSLog(@"~~~~~> HOD UP"); | ||
| NSLog(@"~~~~~> HOD UP BOI"); |
Contributor
There was a problem hiding this comment.
Are these logs necessary?
jguz-pubnub
approved these changes
Mar 20, 2026
jguz-pubnub
approved these changes
Mar 23, 2026
Contributor
Author
|
@pubnub-release-bot release |
|
🚀 Release successfully completed 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(retry-policy): fix excluded endpoints lost after copy
Fix
PNRequestRetryConfigurationcopyWithZonenot copyingexcludedEndpoints, causing all endpoint groups to become eligible for retry afterPNConfigurationcopy.fix(subscribe): enable transport-level retry
Remove hardcoded
retriable = NOfromPNSubscribeRequestso transport-level retry configuration is applied to subscribe long-poll requests.fix(subscribe): prevent duplicate subscribe loops
Add
subscribeCycleGenerationcounter toPNSubscriberto detect and discard stale continuation calls dispatched asynchronously before a new subscribe cycle started.refactor(file-sharing): prevent retry of file upload requests
Add
retriable = NOtoPNFileUploadRequestbecause body streams cannot be rewound after a partial send.refactor(presence): prevent retry of heartbeat requests
Add
requestmethod override withretriable = NOtoPNPresenceHeartbeatRequestbecause presence heartbeat has its own timer-based periodic mechanism.refactor(subscribe): remove reachability ping module
Delete
PNReachabilityclass and remove references fromPubNub.podspecand Framework project in favor of transport-level retry for network recovery.BREAKING CHANGES: Automatic reconnection after prolonged network outage removed; applications must handle
PNUnexpectedDisconnectCategoryand re-subscribe manually.build(spm): use custom modulemap and header search paths for SPM compatibility
Update export script to generate a directory umbrella modulemap instead of flat header symlinks. Configure publicHeadersPath and cSettings in Package.swift.
test(retry-policy): add retry configuration tests
Add unit tests for
copyWithZonepreserving excluded endpoints, default configuration retrying only subscribe, and heartbeat / file upload requests not being retriable.test(subscribe): add generation counter and retry tests Add unit tests verifying generation counter prevents stale subscribe continuations and transport-level retry works for subscribe requests using
NSURLProtocolinterception.