dataengines/weather: Fix stalled data on weather updates
Reason for the change
Due to the weather's ion and the DataEngine's infrastructure it was not possible to remove outdated keys from the data, which resulted in the applet showing stalled info that were no longer relevant, like "wind gust" or the "feels like" indices.
The root cause is double:
- A dataengine's
setData()
will not remove keys that are no longer present in the new data, so we need to force removing them manually viaremoveData()
orremoveAllData()
- There are two concurrent dataengines involved, and removing data on just one is not enough:
- The master
weather
engine which the applet is connected to and serves as a general interface - An internal
ion
engine loaded by the master which does the actual weather job
- The master
To fix the issue let's provide a signal for the ions to request cleaning up the data on the master engine, and call it before setting the new weather updates.
Test plan
- Use these debug branches:
- plasma-workspace work/iasensio/debug-weather, which feeds a fake humidex index each odd minute and removes it on even ones.
- kdeplasma-addos work/iasensio/debug-weather, which updates every minute on a fixed location
OR
- Have the patience to reproduce the bug on your current location.
Bugs fixed
BUG: 481492
FIXED-IN: 6.2
This has been happening forever, but it is a lot more noticeable with the new "Feels like" indicator (the feels like 21º doesn't match with the current temp 11ºC and it was in fact a stalled value from the day before):
Edited by Ismael Asensio