Closed gmm96 closed 3 years ago
Nothing?
Hello?
Hmmm, I assumed I had more work to do after v73 and was going to get back to it, but every time I look at it I don't see a bug?
Doesn't v73 automatically attempt to update weather when the network is connected? Have you installed the latest version of the widget and restarted plasma?
An HTTP Error 0 has never set lastForecastAt = Date.now()
, so pressing the agenda refresh should absolutely fetch the weather if the NetworkMonitor didn't work.
I will not lower the update interval as we collectively have a limited amount of OpenWeatherMap API requests. That is why it is disabled.
Likely facing the same issue. Upon restart, no weather information is shown unless I change location. Refreshing agenda does not help. I'm on v73 already.
Hmmm, I assumed I had more work to do after v73 and was going to get back to it, but every time I look at it I don't see a bug?
Doesn't v73 automatically attempt to update weather when the network is connected? Have you installed the latest version of the widget and restarted plasma?
An HTTP Error 0 has never set
lastForecastAt = Date.now()
, so pressing the agenda refresh should absolutely fetch the weather if the NetworkMonitor didn't work.
- https://github.com/Zren/plasma-applet-eventcalendar/blob/master/package/contents/ui/Logic.qml#L249
- https://github.com/Zren/plasma-applet-eventcalendar/blob/master/package/contents/ui/Logic.qml#L114
I will not lower the update interval as we collectively have a limited amount of OpenWeatherMap API requests. That is why it is disabled.
Like @das22 said, no weather information is shown after boots up computer unless I manually change location. Also tried to refresh the agenda and it doesn't solved the weather issue. I'm in v73.
Here's a screenshot showing the bug. As you can see, no weather info is shown while agenda events are successfuly loaded. Pressing agenda does not fetch the weather info.
Operating System: Manjaro Linux KDE Plasma Version: 5.21.1 KDE Frameworks Version: 5.79.0 Qt Version: 5.15.2 Kernel Version: 5.10.18-1-MANJARO OS Type: 64-bit Graphics Platform: X11 Processors: 8 × Intel® Core™ i7-6700HQ CPU @ 2.60GHz Memory: 15.5 GiB of RAM Graphics Processor: GeForce GTX 960M/PCIe/SSE2
Uhhhg. I've been testing WeatherCanada this whole time (since there isn't an API limit to worry about).
I just tested OpenWeatherMap and noticed a different behavior.
XMLHttpRequest.onerror(undefined)
is logged, and is shown in the MeteogramView as an error.XMLHttpRequest.onerror(undefined)
is logged, the MeteogramView is clear of any errors. I don't remember if I ever finished WeatherCanada's "daily forecast", but that could be the difference. Perhaps there's an error down below in the code that doesn't propagate up to the GUI. So it never sets lastForecastAt = Date.now()
, which means when the NetworkMonitor
detects a connection to the internet it updates as desired.https://user-images.githubusercontent.com/416367/110969379-9f53d780-8326-11eb-9a66-f6e0d7d58c88.mp4
Loading Calendar plugin HolidaysEventsPlugin(0x55e04ac87140)
3
Trying to take space not available BasicAppletContainer_QMLTYPE_150(0x55e04aac8d40, parent=0x55e04a66c260, geometry=0,0 816x512)
trying to show an empty dialog
qml: OpenWeatherMap.fetchDailyWeatherForecast
qml: OpenWeatherMap.fetchHourlyWeatherForecast
qml: HTTP 0 Headers:
qml: OpenWeatherMap.fetchDailyWeatherForecast.err HTTP Error 0: 0
qml: [eventcalendar] updateDailyWeather.err HTTP Error 0: 0
qml: XMLHttpRequest.onerror undefined
qml: OpenWeatherMap.fetchDailyWeatherForecast.err XMLHttpRequest.onerror(undefined) undefined undefined
qml: [eventcalendar] updateDailyWeather.err XMLHttpRequest.onerror(undefined) undefined undefined
qml: HTTP 0 Headers:
qml: updateHourlyWeather.err HTTP Error 0: 0
qml: [eventcalendar] updateHourlyWeather.err HTTP Error 0: 0
qml: XMLHttpRequest.onerror undefined
qml: updateHourlyWeather.err XMLHttpRequest.onerror(undefined) undefined undefined
qml: [eventcalendar] updateHourlyWeather.err XMLHttpRequest.onerror(undefined) undefined undefined
trying to show an empty dialog
https://user-images.githubusercontent.com/416367/110969465-babee280-8326-11eb-84af-ab6c935d9f18.mp4
Loading Calendar plugin HolidaysEventsPlugin(0x556d4c8af1e0)
3
Trying to take space not available BasicAppletContainer_QMLTYPE_140(0x556d4c50c330, parent=0x556d4c5a3660, geometry=0,0 816x512)
trying to show an empty dialog
qml: HTTP 0 Headers:
qml: WeatherCanada.fetchDailyWeatherForecast.err HTTP Error 0: 0
qml: XMLHttpRequest.onerror undefined
qml: WeatherCanada.fetchDailyWeatherForecast.err XMLHttpRequest.onerror(undefined) undefined undefined
qml: HTTP 0 Headers:
qml: WeatherCanada.fetchHourlyWeatherForecast.err HTTP Error 0: 0
qml: XMLHttpRequest.onerror undefined
qml: WeatherCanada.fetchHourlyWeatherForecast.err XMLHttpRequest.onerror(undefined) undefined undefined
trying to show an empty dialog
qml: HTTP 0 Headers:
qml: WeatherCanada.fetchDailyWeatherForecast.err HTTP Error 0: 0
qml: XMLHttpRequest.onerror undefined
qml: WeatherCanada.fetchDailyWeatherForecast.err XMLHttpRequest.onerror(undefined) undefined undefined
qml: HTTP 0 Headers:
qml: WeatherCanada.fetchHourlyWeatherForecast.err HTTP Error 0: 0
qml: XMLHttpRequest.onerror undefined
qml: WeatherCanada.fetchHourlyWeatherForecast.err XMLHttpRequest.onerror(undefined) undefined undefined
After fixing the WeatherCanada code and adding a bunch of checks, I finally found the bug. Apparently in my Requests.js
library I was not passing the xhr
to the callback when there's a network error and xhr.onerror()
is called. Since xhr
wasn't passed to the callback, the code higher up couldn't check if the error was xhr.status == 0
to treat it as a "not connected" error. Since it wasn't, lastForcastErr = Date.now()
was set, forcing the user to wait until the next update interval.
Bug should be fixed on git master. I'll publish a release once I fix the plasma-nm issue.
Option to modify weather polling interval in common app settings is marked as disable, so I cannot modify the polling interval. Parameter cannot either be found in advaced parameters, so I wonder how to do it.
This is important for me, as my system always boots up firstly the widget before the WiFi connection, so I cannot get weather updates unless I manually change the location.