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

Upstream weather service partial outage is not handled #4

Open
mkrauss opened this issue Apr 30, 2024 · 3 comments
Open

Upstream weather service partial outage is not handled #4

mkrauss opened this issue Apr 30, 2024 · 3 comments

Comments

@mkrauss
Copy link

mkrauss commented Apr 30, 2024

Thanks for the fantastic repo, this has been a very useful learning tool.

I had it working at first, but at some point the upstream API call at WeatherFetcher.scala line 26 is returning an empty currentConditions element. This would have been more confusing if it happened when I was first trying to get it going. When this problem first started, both Squamish and Netinat were failing. At the current moment, Netinat is working, but Squamish is still out.

I found this comment on a similar issue for a different region here (home-assistant/core#101533 (comment)) so maybe this is something that the code should be able to more gracefully handle. Although I could see if you want to leave it as is to keep the example pure. Maybe even just make a few more stations available, and add a warning that they could be out would help?

@raquo
Copy link
Owner

raquo commented May 2, 2024

Ah it seems that I am too late to debug this, they must have fixed the station outage already.

Do you remember what exactly you've seen in the API response? Was the API returning <currentConditions></currentConditions>? As in, the element was present, but had no contents?

If that's the case, it looks like it would be quite painful to properly represent that in the phobos XML decoders that we use.

I guess we could work around the issue by regex-finding <currentConditions>[whitespace]</currentConditions> in responseText in WeatherFetcher.scala:31...

@mkrauss
Copy link
Author

mkrauss commented May 4, 2024

Yes, the element was present but had no contents, definitely. If I recall correctly, I think it was actually <currentConditions/>, a single self-closing tag, but I'm not completely sure of that.

@raquo
Copy link
Owner

raquo commented May 4, 2024

Good to know, thanks. Makes sense.

Ideally I'd rather fix this when I can see the error happening, so if anyone sees this error again on the weather gradient page, please ping me here. Otherwise, I'll get to it... eventually...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants