-
Notifications
You must be signed in to change notification settings - Fork 357
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
feat(fcm): Add HTTP2 support for sendEach()
and sendEachForMulticast()
#2550
base: master
Are you sure you want to change the base?
Conversation
sendEach()
and sendEachForMulticast
sendEach()
and sendEachForMulticast()
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.
Thanks, Jonathan!
The first pass (to quickly unblock you) LGTM. I will take another look at the tests.
Let's get an internal API proposal going soon
sendEach()
and sendEachForMulticast()
sendEach()
and sendEachForMulticast()
Thanks Jonathan! Let's make the changes we discussed in the API proposal and do another pass. We should be good to go then! |
* ``` | ||
* | ||
* @deprecated This is to be removed once the HTTP/2 transport is universally safe. | ||
*/ |
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 get a TW review on this?
* messaging.sendEach(messages); | ||
* ``` | ||
* | ||
* @deprecated This is to be removed once the HTTP/2 transport is universally safe. |
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.
This is to be removed once the HTTP/2 transport implementation is universally safe.
?
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.
Yeah, I'm not crazy about that wording either. Can we give a more concrete criteria than safety?
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.
LG! But I do have comments :)
Can you use your eagle eye and do a scrub for literals that lack backticks Lahiru? Thanks!
@@ -221,6 +223,22 @@ export class Messaging { | |||
return this.appInternal; | |||
} | |||
|
|||
/** | |||
* Enables the use of the legacy HTTP/1.1 transport for sendEach() and sendEachForMulticast(). |
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.
Should this be "layer," as in "the x transport layer?"
Let's do either that or drop the "the," with backticks like:
"Enables the use of legacy HTTP/1.1 transport for sendEach()
and sendEachForMulticast()
.
* messaging.sendEach(messages); | ||
* ``` | ||
* | ||
* @deprecated This is to be removed once the HTTP/2 transport is universally safe. |
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.
Yeah, I'm not crazy about that wording either. Can we give a more concrete criteria than safety?
* Default retry configuration for HTTP requests. Retries up to 4 times on connection reset and timeout errors | ||
* as well as HTTP 503 errors. Exposed as a function to ensure that every HttpClient gets its own RetryConfig | ||
* Default retry configuration for HTTP and HTTP/2 requests. Retries up to 4 times on connection reset and timeout | ||
* errors as well as 503 errors. Exposed as a function to ensure that every RequestClient gets its own RetryConfig |
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.
Let's backtick these literals.
} | ||
|
||
/** | ||
* Sends an HTTP request to a remote server. If the server responds with a successful response (2xx), the returned |
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.
There are literals in this long comment that need backticks.
* Sends an HTTP request to a remote server. If the server responds with a successful response (2xx), the returned | ||
* promise resolves with an RequestResponse. If the server responds with an error (3xx, 4xx, 5xx), the promise rejects | ||
* with an RequestResponseError. In case of all other errors, the promise rejects with a FirebaseAppError. If a | ||
* request fails due to a low-level network error, transparently retries the request once before rejecting the |
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.
Let's provide a subject noun here -- what entity retries? The server/backend/promise?
* Sends an HTTP/2 request to a remote server. If the server responds with a successful response (2xx), the returned | ||
* promise resolves with an RequestResponse. If the server responds with an error (3xx, 4xx, 5xx), the promise rejects | ||
* with an RequestResponseError. In case of all other errors, the promise rejects with a FirebaseAppError. If a | ||
* request fails due to a low-level network error, transparently retries the request once before rejecting the |
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.
Subject here too please, thanks!
|
||
constructor(private readonly config: HttpRequestConfig) { | ||
/** | ||
* An adapter class with common functionality needed to extract options and entity data from a RequestConfig. |
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.
Looks like a literal.
// GET and HEAD requests do not support entity (body) in request. | ||
return this.method !== 'GET' && this.method !== 'HEAD'; | ||
} | ||
} | ||
|
||
/** | ||
* An adapter class for extracting options and entity data from an HttpRequestConfig. |
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.
Another literal.
Added:
sendEach()
andsendEachForMulitcast()
enableLegacyTransport()
When sending messages using
sendEach()
orsendEachForMulitcast()
a HTTP/2 connection is now used by default.In order to use the legacy HTTP/1.1 versions of these methods, the
enableLegacyTransport()
method must be used. This method is already marked as deprecated and will be removed once the HTTP/2 transport is considered fully stable.Related: #2488