Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the async issue for StackOverflow API calls #7

Open
havanagrawal opened this issue Feb 24, 2017 · 0 comments
Open

Fix the async issue for StackOverflow API calls #7

havanagrawal opened this issue Feb 24, 2017 · 0 comments

Comments

@havanagrawal
Copy link
Contributor

We should probably start using promises/futures for our StackOverflow API calls. Right now, the behavior is really unpredictable (read as "completely wrong")

For instance, the function getLastActivityTime in watcher.js doesn't actually wait for getting the last activity time, and always ends up adding 0 as the last known time.
We could fix this by

  1. Passing userId to the function
  2. Updating the watcher in getLastActivityTime inside the callback itself, and return nothing

but that's just bad design imho.

Solutions:

  1. Use promises/futures
  2. Use a better rest client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant