kh90909 / OakTerm

Serial terminal for the Digistump Oak over the Particle Cloud
8 stars 2 forks source link

Move pollers into promise chain #19

Closed emcniece closed 8 years ago

emcniece commented 8 years ago

The two setInterval pollers are now available within a promise, and are subsequently initiated in the do_login() promise chain. This ensures that polling only starts once authentication has passed.

When testing this initially the update_devinfo poller was doubling up, suggesting that the setInterval had been processed twice. To avoid this, a new pollers[] array was added, and the start_pollers() function checks to make sure each poller is only added once.

Reference: https://github.com/kh90909/OakTerm/issues/5

emcniece commented 8 years ago

Merge conflicts resolved - ready for testing and merge. https://rawgit.com/emcniece/OakTerm/fix/i5-devinfo-after-auth/index.html

emcniece commented 8 years ago

Merge conflicts resolved - ready for testing and merge. https://rawgit.com/emcniece/OakTerm/fix/i5-devinfo-after-auth/index.html

emcniece commented 8 years ago

Discovered a bug where the do_login() promise chain would halt at the start_pollers promise and wouldn't populate the devices right away. This was fixed by adding a resolve() to the start_pollers function (d'oh)

Ready for testing again.