• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Synchronous requests [solved]

Scheduled Pinned Locked Moved Development
14 Posts 2 Posters 7.5k Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    MichMich Admin
    last edited by May 12, 2016, 2:41 PM

    Will fork your module tomorrow and give it a try.

    1 Reply Last reply Reply Quote 0
    • P Offline
      paviro Admin
      last edited by May 12, 2016, 2:42 PM

      Thanks! :)

      We're all stories in the end. Just make it a good one, eh?

      – The Doctor

      1 Reply Last reply Reply Quote 0
      • M Offline
        MichMich Admin
        last edited by MichMich May 13, 2016, 7:57 AM May 13, 2016, 7:56 AM

        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#L38

        Then 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 (above for (var i = 0; i < JSON.parse(body).length; i++) {).

        Thats all! :)

        1 Reply Last reply Reply Quote 1
        • P Offline
          paviro Admin
          last edited by May 13, 2016, 12:03 PM

          And there comes the “Doh!” moment! :D Thanks completely overlooked that…

          We're all stories in the end. Just make it a good one, eh?

          – The Doctor

          1 Reply Last reply Reply Quote 1
          • 1
          • 2
          • 2 / 2
          2 / 2
          • First post
            11/14
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy