-
Notifications
You must be signed in to change notification settings - Fork 0
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
Fix HTTP Protocol and overall SDK enhancements #71
Merged
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
…parameter, this will help later to add more event if we need to without breaking changes
…ing even after calling disconnect
…st, add event to handle error during request
… to still be open
…rading sdk version
…0 OK", instead the response should be forwarded
Merged
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.
What does this PR do ?
Bump version to 1.2.4
Dependencies
Upgrade
ktor
dependencies to1.6.8
Upgrade gradle version to
7.4
README
Describe that there are two protocols now [HTTP, Websocket]
Update dependencies list
Remove a section about BINTRAY repository that is now obsolete.
Add compatibility matrix
HTTP Protocol
Finalize HTTP Protocol implementation
HTTP Protocol is now using coroutines to avoid blocking the main thread while making HTTP Requests
Fix a bug where requests were not properly resolved because of the returned requestId from Kuzzle
Websocket Protocol
The websocket protocol was not closed properly after calling
disconnect
.This behaviour was preventing the processes using the SDK from stopping.
This is now fixed
Enhance event system
The previous event system was limited, it was only possible to give one string argument to the event callback which was not ideal because if we needed to have an event with more parameters than only one string, we were forced to change the callback of every event to handle more parameters, it could cause trouble for both us and users of the SDK since it would be really hard to avoid breaking changes when adding a new parameter to an event.
The new event system is design to avoid this issue, by registering a callback to an event class, once an event is sent with the
trigger
method, only the callback taking the same event class as the one given to thetrigger
method are going to be called.This allows us to easily add new properties to an event without breaking the callbacks parameters both internaly in the SDK and externaly for the user.
Usage example with creating a new Event
Snippets Tests
Fix Java template that were comparing strings with
==
instead ofequals
leading to condition to always be falseFix Kotlin template that were missing condition to use the HTTP protocol or Websocket protocol during the different test phases
Fix NullPointerException that was occuring during snippet tests because
System.getenv(<key>)
was returning null when an environment variable was not setRemove
protocols
configuration from each snippet to use the global snippet config and avoid repetition