muatik / healthier

health tracker application - Mustafa Atik - SWE 573 - Fall'16 homework project
MIT License
13 stars 4 forks source link

for each new keypress, previous request for autocomplete list should be stopped #38

Closed muatik closed 7 years ago

muatik commented 7 years ago

the autocomplete lists in the food consumption form and the physical activity form makes a new request when users press a key in the input box. after getting responses to the requests, this list is filled with items. however, it is expected that the list should be filled in accordance with the latest value of the input box.

image

currently, each request is sent to the API server in parallel so that sometimes old requests complete later than newer requests. these unordered requests cause the autocomplete list to show old content.

To solve this issue, just before sending a new request, previous requests, if available, need to be canceled.