Read the statement by Michael Teeuw here.
Synchronous requests [solved]
-
Will fork your module tomorrow and give it a try.
-
Thanks! :)
-
Ok, I looked into it, and it really is pretty simple and obvious when I’ll explain you. So prepare for a “Doh!” moment … ;)
Right before you do the request to WunderList, you empty the items array:
https://github.com/paviro/MMM-Wunderlist/blob/master/fetcher.js#L38Then if Wunderlist responds, you fill the items array with new items.
This means that as long as your fetcher is waiting for wunderlist to respond, the items array is empty. If in the meantime an other fetcher is finished fetching, it uses the items array to make a full list. But that array is then still empty, waiting to be filled after the wunderlust response.
The solution? Move line 38 (
items = [];
) to line 51 (abovefor (var i = 0; i < JSON.parse(body).length; i++) {
).Thats all! :)
-
And there comes the
“Doh!” moment
! :D Thanks completely overlooked that…