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

[neohub] Improved Web-Socket Communications #16312

Merged
merged 7 commits into from Mar 15, 2024

Conversation

andrewfg
Copy link
Contributor

This PR makes a few improvements -- in the case when the communication is done via a web-socket -- as follows..

  1. The server certificate is checked by a 'TlsTrustManagerProvider'. This avoids the 'trusting all certificates' warning on start-up.
  2. Call throttling is now based on the time of the response (vs. the time of the request). This prevents exceeding the call rate limit if the hub server is busy. Thus preventing API exceptions.
  3. Improved synchronization of API calls to prevent overlapping requests and responses. Thus preventing API exceptions.
  4. The web-socket is explicitly closed (and reopened) when any exception occurs -- both local client exceptions and remote hub server errors. This prevents lock-up of the web-socket connection. Thus preventing subsequent API exceptions.

Signed-off-by: Andrew Fiddian-Green software@whitebear.ch

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg added enhancement An enhancement or new feature for an existing add-on work in progress A PR that is not yet ready to be merged labels Jan 22, 2024
@andrewfg andrewfg self-assigned this Jan 22, 2024
@andrewfg andrewfg added work in progress A PR that is not yet ready to be merged and removed work in progress A PR that is not yet ready to be merged labels Jan 25, 2024
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg removed the work in progress A PR that is not yet ready to be merged label Feb 7, 2024
@andrewfg andrewfg requested a review from a team February 7, 2024 18:22
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg added bug An unexpected problem or unintended behavior of an add-on and removed enhancement An enhancement or new feature for an existing add-on labels Mar 4, 2024
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
@andrewfg andrewfg requested a review from lolodomo March 15, 2024 12:20
Copy link
Contributor

@lolodomo lolodomo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you

@lolodomo lolodomo merged commit a2db131 into openhab:main Mar 15, 2024
3 checks passed
@lolodomo lolodomo added this to the 4.2 milestone Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants