-
Notifications
You must be signed in to change notification settings - Fork 56
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
1529 convert realtime to use promises #1576
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
012e586
to
bbf32b6
Compare
14e1e5b
to
b429c13
Compare
When I added whenPromiseSettles in cd6c2d8, I didn’t realise that TypeScript types the `catch` callback’s argument as `any`, which doesn’t make much sense to me given that the argument of a `catch` clause is typed as `unknown` (the latter seeming more appropriate). So, make it explicit that we’re performing a type assertion on the error.
The compiler knows that these are non-nullish, which will come in handy.
For consistency with our other callbacks.
The approach taken here is the same as that taken in 2001675, in order to be able to emit both an error _and_ the response body. Note that in the "just in case" handling of thrown errors I’ve just typed the thrown error as `any` and not worried about the consequences of doing so; we can figure out how to handle this properly and consistently in #1617.
Resolves #1533.
The type assertions masked quite a few inconsistencies, which I’ve attempted to handle here.
We removed RequestCallback in 146ca71.
TODO remove this, since I removed it on the base branch too
TODO it’s a nuisance that we can’t access the event via promises, so this is still using `once` with callbacks
TODO explain this queueing thing TODO put this request removal in the right place
bbf32b6
to
1347a96
Compare
10be312
to
2cf5a6b
Compare
Base automatically changed from
1533-remove-callbacks-from-http-code
to
integration/v2
February 21, 2024 13:38
Closing for now; we can pick this up again in the future if we want. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.