Skip to content

dataengines/weather: Fix stalled data on weather updates

Ismael Asensio requested to merge work/iasensio/weather-fix-stalled-data into master

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 via removeData() or removeAllData()
  • 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

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

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):

Screenshot_20240825_125509

Edited by Ismael Asensio

Merge request reports

Loading