-
Notifications
You must be signed in to change notification settings - Fork 78
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
warm up connection #399
warm up connection #399
Conversation
Size Change: +296 B (0%) Total Size: 191 kB
|
src/client.js
Outdated
@@ -56,6 +56,7 @@ export class StreamChat { | |||
const defaultOptions = { | |||
timeout: 3000, | |||
withCredentials: false, // making sure cookies are not sent | |||
warmUp: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets roll with this disabled first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/client.js
Outdated
const handshake = await this.wsConnection.connect(); | ||
this.connectionID = this.wsConnection.connectionID; | ||
if (this.options.warmUp) { | ||
// wait for warm up connection to complete | ||
await warmUp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a fire and forget is better for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…r since it ends on proxy)
src/client.js
Outdated
@@ -56,6 +56,7 @@ export class StreamChat { | |||
const defaultOptions = { | |||
timeout: 3000, | |||
withCredentials: false, // making sure cookies are not sent | |||
warmUp: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a code comment about what does this mean exactly?
createUserToken(user), | ||
); | ||
|
||
let t0 = new Date().getTime(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using performance would be better for more accurate numbers since uses counters for relative time than real time system
src/client.js
Outdated
@@ -491,6 +492,9 @@ export class StreamChat { | |||
case 'patch': | |||
response = await this.axiosInstance.patch(url, data, requestConfig); | |||
break; | |||
case 'options': | |||
response = await this.axiosInstance.options(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response = await this.axiosInstance.options(url); | |
response = await this.axiosInstance.options(url, requestConfig); |
The api_key
request header should be included, so the preflight request doesn't fail
…mup-tls-conn # Conflicts: # src/client.js
Submit a pull request
CLA
Description of the pull request