weather-widget icon indicating copy to clipboard operation
weather-widget copied to clipboard

Not refreshing anymore

Open DarkMatter opened this issue 8 years ago • 14 comments

Hey there, I really love what you have done with this widget. Unfortunately, as of about two weeks ago, I've been having reiterated trouble with the app. It is incapable of steadily retrieve weather information, prompting me to wonder if I am connected to the internet. If I refresh the widget a bunch of times, it sometimes ends up "clicking" with the server and showing me weather information, but once the automatic refresh cycle hits, it will again fail to retrieve info.

Any ideas why this might've suddenly occurred? I have not touched the widgets code for many months.

I appreciate any time you take to address this question.

DarkMatter avatar Dec 22 '16 22:12 DarkMatter

When I finished my message, I decided to tamper with the code a bit, and see what might be up. So, I decided to turn automatic location search off (true) and instead write down London, and Ontario as the City and Region. That seems to have done the trick. It is still curious, however, since when it prompted me about the failure to retrieve info, it did still show that it was in London, ON.

DarkMatter avatar Dec 22 '16 22:12 DarkMatter

It sounds like you are experiencing issues with the geolocation service. Does it work fine for other apps / websites?

felixhageloh avatar Dec 30 '16 09:12 felixhageloh

Yeah, works fine in general. By the way, after manually entering the location, it turned out as only a temporary fix, as the location service was once again unable to retrieve data. I am not sure how to approach this problem since all other apps have no issues.

On 30 Dec 2016 4:52 a.m., "Felix" [email protected] wrote:

It sounds like you are experiencing issues with the geolocation service. Does it work fine for other apps / websites?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/felixhageloh/weather-widget/issues/36#issuecomment-269752571, or mute the thread https://github.com/notifications/unsubscribe-auth/ARAg0dbiCdajWgqu4e345koBNwzPU4QBks5rNNRwgaJpZM4LUbJi .

DarkMatter avatar Dec 30 '16 17:12 DarkMatter

I'm seeing the same exact issue. Does seem to matter if I force a static location or not though. It seems all very random and I am just wondering if Apple sent out a new update that might be causing issues with the widget. Last updates that I have are the macOS 10.12.2 Update that was installed on 12/31 as well as the Command line tool for XCode (v 8.2) which also was installed on 12/31. Below is a link to the 10.12.2 update info it it helps at all.

https://support.apple.com/en-us/HT207307

perrybucsdad avatar Jan 02 '17 14:01 perrybucsdad

This has been annoying me so I did a little digging. Tracking my network traffic shows that on average the yahooapi is slow (2+s to return) and more often then not will just return a JSON object like the one below.

{"query":{"count":0,"created":"2017-01-09T17:45:18Z","lang":"en-US","results":null}}

I ended up looking into yahoo api and the weather test page https://developer.yahoo.com/weather/ shows the same results.

My best guess is that the weather/geo APIs being used to get the data are heavily hit and yahoo just decides not to respond to every call.

kyletitus avatar Jan 09 '17 18:01 kyletitus

That's unfortunate, since it seems like a fix won't come if the problem is direct from Yahoo's servers. This is awful. I like my Hyrule font Weather report so much :(

On Mon, Jan 9, 2017 at 1:17 PM, Kyle Titus [email protected] wrote:

This has been annoying me so I did a little digging. Tracking my network traffic shows that on average the yahooapi is slow (2+s to return) and more often then not will just return a JSON object like the one below.

{"query":{"count":0,"created":"2017-01-09T17:45:18Z","lang": "en-US","results":null}}

Finding the yahoo api weather test page https://developer.yahoo.com/ weather/ shows the same results.

My best guess is that the weather/geo APIs being used to get the data are heavily hit and yahoo just decides not to respond to every call.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/felixhageloh/weather-widget/issues/36#issuecomment-271361242, or mute the thread https://github.com/notifications/unsubscribe-auth/ARAg0ZJwSJokK4P56y_ssoXF7jAj6eJ_ks5rQnm0gaJpZM4LUbJi .

--

DarkMatter avatar Jan 09 '17 18:01 DarkMatter

Is there a way for it to wait (longer?) for the return from Yahoo? @felixhageloh , is there a fix for this? I'm about ready to remove this and find something different, but I hate to do that as I love this little widget.

perrybucsdad avatar Jan 14 '17 03:01 perrybucsdad

Anyone have any progress on resolving this? I'd love to be able to use this widget again.

zedozedo avatar Jan 25 '17 04:01 zedozedo

sorry for the late reply - don't have much time maintaining this widget at the moment unfortunately. If the issue is indeed with Yahoo then the only solution I can see is switching to another api

felixhageloh avatar Jan 29 '17 16:01 felixhageloh

probably a duplicate of https://github.com/felixhageloh/weather-widget/issues/29 then

felixhageloh avatar Jan 29 '17 16:01 felixhageloh

There is another weather service btw http://wttr.in It has quite a different output tho, so adjusting the widget to use it will be quite a rewrite

felixhageloh avatar Jan 29 '17 16:01 felixhageloh

Really appreciate all you've done.

FWIW - my widget seems to get a valid response if I refresh 1 - 4 times (I find it quicker to do this using the debug console :)) - similar using the web API interface - ie I don't get a 'null'.

Building on @kyletitus and @perrybucsdad comments above - I wondered if there is a way (that's not too non-trivial!) to get the call to repeat if receives null, or wait and retry - abandoning after n attempts. Apologies if a stupid idea - I'm n00b level Javascript…

I have my widget set to refresh every 20 mins and I'm very happy manually setting the 'first' forecast using the above technique (ie mashing refresh until I get a result and corresponding desktop images!) , but don't want to have to repeat this every 20 mins as it often fails on this interval with just one request. So, if it could keep that forecast until it received a non-null return I'd be more than happy :)

kevanchristmas avatar Jan 30 '17 09:01 kevanchristmas

I played around with this some at lunch today and added basic retry logic with some local-storage caching. That pull request is here https://github.com/felixhageloh/weather-widget/pull/37

I am mainly a java backend guy so don't hate me if its terrible. That being said, its been running on my machine (MBP, macOSx 10.11.6) for the last couple hours and it all seems to be working. Please feel free to throw comments on the pull request I will do what I can to improve it. Also please pull the branch and try it out for yourselves.

kyletitus avatar Jan 30 '17 21:01 kyletitus

thanks for the PR @kyletitus! Would you by any chance be willing to take over this widget?

felixhageloh avatar Jan 31 '17 08:01 felixhageloh