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

[dwdunwetter] Improve server problem handling #15405

Merged
merged 4 commits into from
Sep 23, 2023

Conversation

lsiepel
Copy link
Contributor

@lsiepel lsiepel commented Aug 10, 2023

Used it for a couple of days and had no problem.

Test jar 4.1.0 here: https://1drv.ms/u/s!AnMcxmvEeupwjrMmX76PHq61-JUHFQ?e=K0E0TR

lsiepel added 2 commits August 6, 2023 19:57
Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: lsiepel <leosiepel@gmail.com>
@lsiepel lsiepel requested a review from limdul79 as a code owner August 10, 2023 21:45
@lsiepel lsiepel added the bug An unexpected problem or unintended behavior of an add-on label Aug 10, 2023
Signed-off-by: lsiepel <leosiepel@gmail.com>
@lsiepel lsiepel requested a review from a team September 5, 2023 20:46
Copy link
Contributor

@daMihe daMihe left a comment

Choose a reason for hiding this comment

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

Generally, it looks like a simple approach to pre check some data. Currently you are testing only for <?xml which is quite generic. What do you think about extending this check to some words which appear in every download, e.g. FeatureCollection?

@lsiepel
Copy link
Contributor Author

lsiepel commented Sep 9, 2023

It is not meant to check data correctness. It is a check only to determine of the service works under normal conditions. If the output is xml, it can be assumed to be correct according to the API documentation. If it is not XML, the service is down, degraded, in maintenance or similar.
Validating the XML itself is a different use case. Could be usefull, would also cause a lot of overhead. Anyway i have not seen DTD to use for validation, so i left a more complex check out of this pr.

@daMihe
Copy link
Contributor

daMihe commented Sep 9, 2023

Sure, that's something i would not expect in smallest detail. But as HTML (showing an Error) can be valid XML including the <?xml tag, a little meta check would be nice. That does not mean the code should parse anything in detail but instead looking for some magic strings (like libmagic is doing for content type detection) for the API. I think that's little effort to get a possibly significant better result.

Signed-off-by: Leo Siepel <leosiepel@gmail.com>
@lsiepel lsiepel requested a review from daMihe September 15, 2023 20:22
Copy link
Contributor

@daMihe daMihe left a comment

Choose a reason for hiding this comment

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

Okay. A quick functional test did also work.

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 3b30d5a into openhab:main Sep 23, 2023
2 checks passed
@lolodomo lolodomo added this to the 4.1 milestone Sep 23, 2023
@lsiepel lsiepel deleted the dwdunwetter-response branch September 23, 2023 19:06
Pshatsillo pushed a commit to Pshatsillo/openhab-addons that referenced this pull request Sep 29, 2023
* Fix openhab#14691
* Add country tag

---------

Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
pat-git023 pushed a commit to pat-git023/openhab-addons that referenced this pull request Oct 13, 2023
* Fix openhab#14691
* Add country tag

---------

Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this pull request Oct 21, 2023
* Fix openhab#14691
* Add country tag

---------

Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
querdenker2k pushed a commit to querdenker2k/openhab-addons that referenced this pull request Oct 29, 2023
* Fix openhab#14691
* Add country tag

---------

Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: querdenker2k <querdenker2k@gmx.de>
austvik pushed a commit to austvik/openhab-addons that referenced this pull request Mar 27, 2024
* Fix openhab#14691
* Add country tag

---------

Signed-off-by: lsiepel <leosiepel@gmail.com>
Signed-off-by: Leo Siepel <leosiepel@gmail.com>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
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.

[dwdunwetter] should handle properly response messages
3 participants