HSLdevcom / digitransit-ui

Digitransit UI ("Reittiopas.fi")
https://www.reittiopas.fi/
Other
237 stars 130 forks source link

Optimize notification requests to favourite service #4968

Closed vesameskanen closed 3 months ago

vesameskanen commented 3 months ago

A recent change in favourites store introduced a new bug, making the store to deliver a new set of favourites in every read. In addition to that, favourite store got updated once when favorites were read. These together caused a burst of 4-7 favorite service requests when UI was loaded, and one call more in each page mount.

Now UI fetches notifiers only once. New fetch happens only if favourites genuinely change.