Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mandatory uuid parameter#240

Merged
mohitpubnub merged 5 commits intomasterpubnub/javascript:masterfrom
clen221pubnub/javascript:clen221Copy head branch name to clipboard
Jan 12, 2022
Merged

mandatory uuid parameter#240
mohitpubnub merged 5 commits intomasterpubnub/javascript:masterfrom
clen221pubnub/javascript:clen221Copy head branch name to clipboard

Conversation

@mohitpubnub
Copy link
Contributor

@mohitpubnub mohitpubnub commented Jan 4, 2022

refactor: Breaking change, uuid parameter is mandatory.

uuid is required parameter in PubNub constructor.

BREAKING CHANGES: SDK will not generate or store uuid automatically. uuid is required parameter in PubNub constructor.

@mohitpubnub mohitpubnub requested a review from a user January 4, 2022 11:18
Copy link
Contributor

@parfeon parfeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes looks good. Should we have another test case for setter?

test/integration/components/config.test.js Show resolved Hide resolved
@parfeon parfeon self-requested a review January 5, 2022 08:35
@mohitpubnub mohitpubnub requested a review from phairow January 6, 2022 23:40
phairow
phairow previously approved these changes Jan 7, 2022
Copy link
Contributor

@phairow phairow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

};

export default class {
_db: DatabaseInterface;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to see this removed since it was not used

if (!val || typeof val !== 'string' || val.trim().length === 0) {
throw new Error('Missing uuid parameter. Provide a valid string uuid');
}
this.UUID = val;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I know we discussed this and I will hold back my concern on throwing exceptions from constructors :) it is a C# and Java thing (something to do with destructor cleanup of resources that is not relevant here) which made me take that stand. For this it should be fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since constructor calls setUUID it will have potential to throw when constructor is called

let storageParams = { uuid: 'customUUID', networking: networking };
const pubnub = new PubNub(storageParams);
assert.equal(pubnub.getUUID(), 'customUUID');
assert.throws(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice test

publishKey: 'myPublishKey',
uuid: ' '
};
assert.throws(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice test

are
are previously approved these changes Jan 7, 2022
parfeon
parfeon previously approved these changes Jan 12, 2022
@mohitpubnub
Copy link
Contributor Author

@client-engineering-bot release as v5.0.0

@github-actions github-actions bot dismissed stale reviews from parfeon, are, and phairow via f6880b0 January 12, 2022 14:56
@mohitpubnub mohitpubnub merged commit 4f9d197 into master Jan 12, 2022
@mohitpubnub mohitpubnub deleted the clen221 branch January 12, 2022 16:57
@github-actions
Copy link

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.