Skip to content

Commit

Permalink
fix/CLEN-1440 (#335)
Browse files Browse the repository at this point in the history
* fix: missing get and set methods for userId are added

* PubNub SDK v7.3.1 release.

---------

Co-authored-by: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com>
  • Loading branch information
mohitpubnub and pubnub-release-bot committed Aug 21, 2023
1 parent 9584344 commit 8adfccd
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 10 deletions.
11 changes: 8 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
changelog:
- date: 2023-08-21
version: v7.3.1
changes:
- type: bug
text: "Fixes issue of missing get and set methods for userId field of PubNub configuration."
- date: 2023-07-26
version: v7.3.0
changes:
Expand Down Expand Up @@ -880,7 +885,7 @@ supported-platforms:
- 'Ubuntu 14.04 and up'
- 'Windows 7 and up'
version: 'Pubnub Javascript for Node'
version: '7.3.0'
version: '7.3.1'
sdks:
- full-name: PubNub Javascript SDK
short-name: Javascript
Expand All @@ -896,7 +901,7 @@ sdks:
- distribution-type: source
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.3.0.zip
location: https://github.com/pubnub/javascript/archive/refs/tags/v7.3.1.zip
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down Expand Up @@ -1567,7 +1572,7 @@ sdks:
- distribution-type: library
distribution-repository: GitHub release
package-name: pubnub.js
location: https://github.com/pubnub/javascript/releases/download/v7.3.0/pubnub.7.3.0.js
location: https://github.com/pubnub/javascript/releases/download/v7.3.1/pubnub.7.3.1.js
requires:
- name: 'agentkeepalive'
min-version: '3.5.2'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v7.3.1
August 21 2023

#### Fixed
- Fixes issue of missing get and set methods for userId field of PubNub configuration.

## v7.3.0
July 26 2023

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ You will need the publish and subscribe keys to authenticate your app. Get your
npm install pubnub
```
* or download one of our builds from our CDN:
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.3.0.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.3.0.min.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.3.1.js
* https://cdn.pubnub.com/sdk/javascript/pubnub.7.3.1.min.js

2. Configure your keys:

Expand Down
4 changes: 3 additions & 1 deletion dist/web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@
return this;
};
default_1.prototype.getVersion = function () {
return '7.3.0';
return '7.3.1';
};
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
this._PNSDKSuffix[name] = suffix;
Expand Down Expand Up @@ -7710,6 +7710,8 @@
this.setCipherKey = modules.config.setCipherKey.bind(modules.config);
this.getUUID = modules.config.getUUID.bind(modules.config);
this.setUUID = modules.config.setUUID.bind(modules.config);
this.getUserId = modules.config.getUserId.bind(modules.config);
this.setUserId = modules.config.setUserId.bind(modules.config);
this.getFilterExpression = modules.config.getFilterExpression.bind(modules.config);
this.setFilterExpression = modules.config.setFilterExpression.bind(modules.config);
this.setHeartbeatInterval = modules.config.setHeartbeatInterval.bind(modules.config);
Expand Down
2 changes: 1 addition & 1 deletion dist/web/pubnub.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/core/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ var default_1 = /** @class */ (function () {
return this;
};
default_1.prototype.getVersion = function () {
return '7.3.0';
return '7.3.1';
};
default_1.prototype._addPnsdkSuffix = function (name, suffix) {
this._PNSDKSuffix[name] = suffix;
Expand Down
2 changes: 2 additions & 0 deletions lib/core/pubnub-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,8 @@ var default_1 = /** @class */ (function () {
this.setCipherKey = modules.config.setCipherKey.bind(modules.config);
this.getUUID = modules.config.getUUID.bind(modules.config);
this.setUUID = modules.config.setUUID.bind(modules.config);
this.getUserId = modules.config.getUserId.bind(modules.config);
this.setUserId = modules.config.setUserId.bind(modules.config);
this.getFilterExpression = modules.config.getFilterExpression.bind(modules.config);
this.setFilterExpression = modules.config.setFilterExpression.bind(modules.config);
this.setHeartbeatInterval = modules.config.setHeartbeatInterval.bind(modules.config);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pubnub",
"version": "7.3.0",
"version": "7.3.1",
"author": "PubNub <support@pubnub.com>",
"description": "Publish & Subscribe Real-time Messaging with PubNub",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ export default class {
}

getVersion() {
return '7.3.0';
return '7.3.1';
}

_addPnsdkSuffix(name, suffix) {
Expand Down
6 changes: 6 additions & 0 deletions src/core/pubnub-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ export default class {

getUUID;

setUserId;

getUserId;

getFilterExpression;

setFilterExpression;
Expand Down Expand Up @@ -669,6 +673,8 @@ export default class {
this.setCipherKey = modules.config.setCipherKey.bind(modules.config);
this.getUUID = modules.config.getUUID.bind(modules.config);
this.setUUID = modules.config.setUUID.bind(modules.config);
this.getUserId = modules.config.getUserId.bind(modules.config);
this.setUserId = modules.config.setUserId.bind(modules.config);
this.getFilterExpression = modules.config.getFilterExpression.bind(modules.config);
this.setFilterExpression = modules.config.setFilterExpression.bind(modules.config);

Expand Down
11 changes: 11 additions & 0 deletions test/integration/components/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ describe('components/config', () => {
assert.equal(pubnub.getUUID(), 'uuid2');
});

it('get/set userId', () => {
let pubnub = new PubNub({
subscribeKey: 'mySubKey',
publishKey: 'myPublishKey',
userId: 'userId1',
});
assert.equal(pubnub.getUserId(), 'userId1');
pubnub.setUserId('userId2');
assert.equal(pubnub.getUserId(), 'userId2');
});

it('throws when both userId and uuid are provided', () => {
let config = { subscribeKey: 'demo', publishKey: 'demo', uuid: 'myUuid', userId: 'myUserId' };

Expand Down

0 comments on commit 8adfccd

Please sign in to comment.