Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: simplify StableWSConnection constructor params #822

Merged
merged 6 commits into from
Nov 26, 2021

Conversation

mahboubii
Copy link
Contributor

CLA

  • I have signed the Stream CLA (required).
  • Code changes are tested

Description of the changes, What, Why and How?

Changelog

@github-actions
Copy link
Contributor

github-actions bot commented Nov 25, 2021

Size Change: -2.63 kB (1%)

Total Size: 261 kB

Filename Size Change
dist/browser.es.js 57.1 kB -671 B (1%)
dist/browser.full-bundle.min.js 30.8 kB -362 B (1%)
dist/browser.js 58 kB -466 B (0%)
dist/index.es.js 57.2 kB -667 B (1%)
dist/index.js 58 kB -461 B (0%)

compressed-size-action

@mahboubii mahboubii requested a review from thesyncim November 26, 2021 08:18
wsBaseURL: Constructor<ChannelType, CommandType, UserType>['wsBaseURL'];
device: Constructor<ChannelType, CommandType, UserType>['device'];
// global from constructor
client: StreamChat<AttachmentType, ChannelType, CommandType, EventType, MessageType, ReactionType, UserType>;
Copy link
Contributor

Choose a reason for hiding this comment

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

nice touch

ferhatelmas
ferhatelmas previously approved these changes Nov 26, 2021
Copy link
Contributor

@ferhatelmas ferhatelmas left a comment

Choose a reason for hiding this comment

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

LGTM

Amazing simplification 🌮

Copy link
Contributor

@vishalnarkhede vishalnarkhede left a comment

Choose a reason for hiding this comment

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

I am loving these changes!! Thanks alot @mahboubii ❤️

vishalnarkhede
vishalnarkhede previously approved these changes Nov 26, 2021
client_request_id: reqID,
};
const qs = encodeURIComponent(JSON.stringify(params));
const token = this.tokenManager.getToken();
return `${this.wsBaseURL}/connect?json=${qs}&api_key=${this.apiKey}&authorization=${token}&stream-auth-type=${this.authType}&X-Stream-Client=${this.userAgent}`;
const token = this.client.tokenManager.getToken();
Copy link
Contributor

@vini-btc vini-btc Nov 26, 2021

Choose a reason for hiding this comment

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

do we really use token and user_token and with the same value on this call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch, could be an old mistake

@mahboubii mahboubii merged commit 9e72cd6 into master Nov 26, 2021
@mahboubii mahboubii deleted the refactor-StableWSConnection-constructor branch November 26, 2021 13:15
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.

4 participants