alercebroker / ztf_explorer

🌚 🔭 💻 ZTF Explorer for the ALeRCE broker
https://alerce.online/
6 stars 0 forks source link

[BUG] Slow queries update current object's view when completed, even if object has changed #323

Closed dirodriguezm closed 3 years ago

dirodriguezm commented 3 years ago

Describe the bug When changing object view, if a query is slow and arrives after the selected object has changed, then it updates the wrong object view.

To Reproduce Steps to reproduce the behavior:

  1. Search for more than 1 object
  2. Open the object details view
  3. Change object
  4. Wait for the object view update

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

Additional context This error happened at a time when the database/api was highly used and responding very slow.

Proposed solution The solution to this would be to cancel queries. For example if a query to the same endpoint is applied, then the former query should be canceled