From 5f04edbfc332b560688e629c2b647e80f827912b Mon Sep 17 00:00:00 2001 From: Client Date: Tue, 28 Jul 2020 20:51:24 +0000 Subject: [PATCH] PubNub SDK v4.15.1 release. --- .pubnub.yml | 9 ++- CHANGELOG.md | 8 +++ Framework/PubNub/Info.plist | 6 +- Framework/PubNub/PubNub-iOS-Info.plist | 6 +- Framework/PubNub/PubNub-tvOS-Info.plist | 6 +- Framework/PubNub/PubNub-watchOS-Info.plist | 6 +- PubNub.podspec | 2 +- PubNub/Misc/PNConstants.h | 4 +- .../Requests/Publish/PNBasePublishRequest.m | 3 +- README.md | 2 +- ...ceivePublishTimetokenWhenDefaultsUsed.json | 53 ++++++++++++++++ ...blishTimetokenWhenReplicationDisabled.json | 53 ++++++++++++++++ ...eivePublishTimetokenWhenStoreDisabled.json | 53 ++++++++++++++++ .../Integration/PNPublishIntegrationTests.m | 62 +++++++++++++++++++ VERSION | 2 +- 15 files changed, 256 insertions(+), 19 deletions(-) create mode 100644 Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenDefaultsUsed.json create mode 100644 Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenReplicationDisabled.json create mode 100644 Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenStoreDisabled.json diff --git a/.pubnub.yml b/.pubnub.yml index ad2c731e6..cf2c2634e 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,16 @@ --- name: objective-c scm: github.com/pubnub/objective-c -version: "4.15.0" +version: "4.15.1" schema: 1 changelog: + - + changes: + - + text: "Fix default issues after migration to publish requests objects usage because of which `replicate` and `store` has been reset to `false`." + type: bug + date: Jul 28, 20 + version: v4.15.1 - changes: - diff --git a/CHANGELOG.md b/CHANGELOG.md index f61c706e8..1c9846406 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## [v4.15.1](https://github.com/pubnub/objective-c/releases/tag/v4.15.1) +July 28 2020 + +[Full Changelog](https://github.com/pubnub/objective-c/compare/v4.15.0...v4.15.1) + +#### Fixed +- Fix default issues after migration to publish requests objects usage because of which `replicate` and `store` has been reset to `false`. + ## [v4.15.0](https://github.com/pubnub/objective-c/releases/tag/v4.15.0) July 27 2020 diff --git a/Framework/PubNub/Info.plist b/Framework/PubNub/Info.plist index 47dc62747..7cde85ae9 100644 --- a/Framework/PubNub/Info.plist +++ b/Framework/PubNub/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 4.15.0 + 4.15.1 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.15.0 + 4.15.1 CFBundleSignature ???? CFBundleVersion - 4.15.0 + 4.15.1 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/Framework/PubNub/PubNub-iOS-Info.plist b/Framework/PubNub/PubNub-iOS-Info.plist index 47dc62747..7cde85ae9 100644 --- a/Framework/PubNub/PubNub-iOS-Info.plist +++ b/Framework/PubNub/PubNub-iOS-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 4.15.0 + 4.15.1 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.15.0 + 4.15.1 CFBundleSignature ???? CFBundleVersion - 4.15.0 + 4.15.1 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/Framework/PubNub/PubNub-tvOS-Info.plist b/Framework/PubNub/PubNub-tvOS-Info.plist index 47dc62747..7cde85ae9 100644 --- a/Framework/PubNub/PubNub-tvOS-Info.plist +++ b/Framework/PubNub/PubNub-tvOS-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 4.15.0 + 4.15.1 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.15.0 + 4.15.1 CFBundleSignature ???? CFBundleVersion - 4.15.0 + 4.15.1 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/Framework/PubNub/PubNub-watchOS-Info.plist b/Framework/PubNub/PubNub-watchOS-Info.plist index 47dc62747..7cde85ae9 100644 --- a/Framework/PubNub/PubNub-watchOS-Info.plist +++ b/Framework/PubNub/PubNub-watchOS-Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable PubNub CFBundleGetInfoString - 4.15.0 + 4.15.1 CFBundleIdentifier com.pubnub.pubnub-objc CFBundleInfoDictionaryVersion @@ -17,11 +17,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 4.15.0 + 4.15.1 CFBundleSignature ???? CFBundleVersion - 4.15.0 + 4.15.1 NSHumanReadableCopyright © 2010 - 2020 PubNub, Inc. NSPrincipalClass diff --git a/PubNub.podspec b/PubNub.podspec index 0bc71ac88..00c954d09 100644 --- a/PubNub.podspec +++ b/PubNub.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.name = 'PubNub' - spec.version = '4.15.0' + spec.version = '4.15.1' spec.summary = 'The PubNub Real-Time Network. Build real-time apps quickly and scale them globally.' spec.homepage = 'https://github.com/pubnub/objective-c' diff --git a/PubNub/Misc/PNConstants.h b/PubNub/Misc/PNConstants.h index 5a9f97ac0..fb7019ae0 100644 --- a/PubNub/Misc/PNConstants.h +++ b/PubNub/Misc/PNConstants.h @@ -15,10 +15,10 @@ #pragma mark General information constants // Stores client library version number -static NSString * const kPNLibraryVersion = @"4.15.0"; +static NSString * const kPNLibraryVersion = @"4.15.1"; // Stores information about SDK codebase -static NSString * const kPNCommit = @"2a04165517fe9fa97fb3807ca0563407aea46578"; +static NSString * const kPNCommit = @"31d74ef9d966fe998132ea59708221463177140f"; /** @brief Stores reference on unique identifier which is used to identify \b PubNub client among other diff --git a/PubNub/Network/Requests/Publish/PNBasePublishRequest.m b/PubNub/Network/Requests/Publish/PNBasePublishRequest.m index 776e5c5e7..298a69474 100644 --- a/PubNub/Network/Requests/Publish/PNBasePublishRequest.m +++ b/PubNub/Network/Requests/Publish/PNBasePublishRequest.m @@ -168,7 +168,8 @@ - (id)preFormattedMessage { - (instancetype)initWithChannel:(NSString *)channel { if ((self = [super init])) { _channel = [channel copy]; - _replicate = YES; + self.replicate = YES; + self.store = YES; } return self; diff --git a/README.md b/README.md index 9807118df..c9949c39c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PubNub 4.15.0 for iOS 9+ +# PubNub 4.15.1 for iOS 9+ [![Twitter](https://img.shields.io/badge/twitter-%40PubNub-blue.svg?style=flat)](https://twitter.com/PubNub) [![Twitter Releases](https://img.shields.io/badge/twitter-%40PubNubRelease-blue.svg?style=flat)](https://twitter.com/PubNubRelease) [![License](https://img.shields.io/github/license/pubnub/objective-c.svg?style=flat)](https://img.shields.io/github/license/pubnub/objective-c.svg) diff --git a/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenDefaultsUsed.json b/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenDefaultsUsed.json new file mode 100644 index 000000000..c13bddb51 --- /dev/null +++ b/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenDefaultsUsed.json @@ -0,0 +1,53 @@ +[ + { + "id" : "03F0F286-32BA-4540-AC52-96FDEDABBD9E", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 60, + "cookies" : true, + "headers" : { + "User-Agent" : "iPhone; CPU iPhone OS 13.6.0 Version", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%22Hello%20there%22?uuid=serhii&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1" + }, + "type" : 0 + }, + { + "id" : "03F0F286-32BA-4540-AC52-96FDEDABBD9E", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%22Hello%20there%22?pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=serhii", + "headers" : { + "Access-Control-Allow-Methods" : "GET", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Allow-Origin" : "*", + "Date" : "Tue, 28 Jul 2020 09:33:59 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "03F0F286-32BA-4540-AC52-96FDEDABBD9E", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNTk1OTI4ODM5OTQ5OTc4MyJd" + }, + "type" : 2 + }, + { + "id" : "03F0F286-32BA-4540-AC52-96FDEDABBD9E", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenReplicationDisabled.json b/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenReplicationDisabled.json new file mode 100644 index 000000000..6242499b8 --- /dev/null +++ b/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenReplicationDisabled.json @@ -0,0 +1,53 @@ +[ + { + "id" : "5F35C44F-667A-4A5D-9B72-800360F1E6E1", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 60, + "cookies" : true, + "headers" : { + "User-Agent" : "iPhone; CPU iPhone OS 13.6.0 Version", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%22Hello%20there%22?norep=1&pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=serhii" + }, + "type" : 0 + }, + { + "id" : "5F35C44F-667A-4A5D-9B72-800360F1E6E1", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%22Hello%20there%22?uuid=serhii&norep=1&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Methods" : "GET", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Allow-Origin" : "*", + "Date" : "Tue, 28 Jul 2020 09:37:22 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "5F35C44F-667A-4A5D-9B72-800360F1E6E1", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNTk1OTI5MDQyNTEzMjk0NSJd" + }, + "type" : 2 + }, + { + "id" : "5F35C44F-667A-4A5D-9B72-800360F1E6E1", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenStoreDisabled.json b/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenStoreDisabled.json new file mode 100644 index 000000000..bdcf1b7bb --- /dev/null +++ b/Tests/Support Files/Fixtures/PNPublishIntegrationTests.bundle/ItShouldPublishWithRequestAndReceivePublishTimetokenWhenStoreDisabled.json @@ -0,0 +1,53 @@ +[ + { + "id" : "0F314AAC-0573-4C61-A33B-7F3EDC37E1DB", + "data" : { + "method" : "get", + "cls" : "NSURLRequest", + "cellular" : true, + "cache" : 1, + "timeout" : 60, + "cookies" : true, + "headers" : { + "User-Agent" : "iPhone; CPU iPhone OS 13.6.0 Version", + "Accept" : "*\/*", + "Connection" : "keep-alive", + "Accept-Encoding" : "gzip,deflate" + }, + "pipeline" : false, + "network" : 0, + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%22Hello%20there%22?pnsdk=PubNub-ObjC-iOS\/4.x.x&seqn=1&uuid=serhii&store=0" + }, + "type" : 0 + }, + { + "id" : "0F314AAC-0573-4C61-A33B-7F3EDC37E1DB", + "data" : { + "status" : 200, + "cls" : "NSHTTPURLResponse", + "url" : "https:\/\/ps.pndsn.com\/publish\/demo\/demo\/0\/test-channel\/0\/%22Hello%20there%22?uuid=serhii&store=0&seqn=1&pnsdk=PubNub-ObjC-iOS\/4.x.x", + "headers" : { + "Access-Control-Allow-Methods" : "GET", + "Content-Type" : "text\/javascript; charset=\"UTF-8\"", + "Access-Control-Allow-Origin" : "*", + "Date" : "Tue, 28 Jul 2020 09:37:39 GMT", + "Content-Length" : "30", + "Cache-Control" : "no-cache", + "Connection" : "keep-alive" + } + }, + "type" : 1 + }, + { + "id" : "0F314AAC-0573-4C61-A33B-7F3EDC37E1DB", + "data" : { + "cls" : "NSData", + "base64" : "WzEsIlNlbnQiLCIxNTk1OTI5MDU5MTU5OTMxMiJd" + }, + "type" : 2 + }, + { + "id" : "0F314AAC-0573-4C61-A33B-7F3EDC37E1DB", + "type" : 4 + } +] \ No newline at end of file diff --git a/Tests/Tests/Integration/PNPublishIntegrationTests.m b/Tests/Tests/Integration/PNPublishIntegrationTests.m index 437c08f15..def065816 100644 --- a/Tests/Tests/Integration/PNPublishIntegrationTests.m +++ b/Tests/Tests/Integration/PNPublishIntegrationTests.m @@ -67,6 +67,68 @@ - (void)setUp { #pragma mark - Tests :: Regular publish +- (void)testItShouldPublishWithRequestAndReceivePublishTimetokenWhenDefaultsUsed { + NSString *channel = [self channelWithName:@"test-channel"]; + PubNub *client = [self createPubNubForUser:@"serhii"]; + NSString *expectedMessage = @"Hello there"; + + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNPublishRequest *request = [PNPublishRequest requestWithChannel:channel]; + request.message = expectedMessage; + + [client publishWithRequest:request completion:^(PNPublishStatus *status) { + XCTAssertFalse(status.isError); + XCTAssertNotNil(status.data.timetoken); + XCTAssertEqual(status.statusCode, 200); + + handler(); + }]; + }]; +} + +- (void)testItShouldPublishWithRequestAndReceivePublishTimetokenWhenReplicationDisabled { + NSString *channel = [self channelWithName:@"test-channel"]; + PubNub *client = [self createPubNubForUser:@"serhii"]; + NSString *expectedMessage = @"Hello there"; + + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNPublishRequest *request = [PNPublishRequest requestWithChannel:channel]; + request.message = expectedMessage; + request.replicate = NO; + + [client publishWithRequest:request completion:^(PNPublishStatus *status) { + XCTAssertFalse(status.isError); + XCTAssertNotNil(status.data.timetoken); + XCTAssertEqual(status.statusCode, 200); + + handler(); + }]; + }]; +} + +- (void)testItShouldPublishWithRequestAndReceivePublishTimetokenWhenStoreDisabled { + NSString *channel = [self channelWithName:@"test-channel"]; + PubNub *client = [self createPubNubForUser:@"serhii"]; + NSString *expectedMessage = @"Hello there"; + + + [self waitToCompleteIn:self.testCompletionDelay codeBlock:^(dispatch_block_t handler) { + PNPublishRequest *request = [PNPublishRequest requestWithChannel:channel]; + request.message = expectedMessage; + request.store = NO; + + [client publishWithRequest:request completion:^(PNPublishStatus *status) { + XCTAssertFalse(status.isError); + XCTAssertNotNil(status.data.timetoken); + XCTAssertEqual(status.statusCode, 200); + + handler(); + }]; + }]; +} + - (void)testItShouldPublishAndReceivePublishTimetoken { NSString *channel = [self channelWithName:@"test-channel"]; PubNub *client = [self createPubNubForUser:@"serhii"]; diff --git a/VERSION b/VERSION index 5c517bf11..fb0557132 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.15.0 +4.15.1