当前位置:网站首页>Solve the problem of data disorder caused by slow asynchronous interface

Solve the problem of data disorder caused by slow asynchronous interface

2022-07-04 21:42:00 Grumpy plums are rotten Online

bug Scene: the repetition

Filter the table data through the drop-down box
Quick screening or after the first screening , Switch the drop-down box immediately before the data returns The filtering results and filtering keywords do not match

Check the back-end interface The returned data is correct Basically, it can be judged that the problem is the slow interface request

Because the data returned by the server in the previous request is relatively slow , Not waiting for the first request to return results , The last request was initiated , And quickly returned the results , At this time, the table must show the result of the next time ;
After a few seconds , The result of the first request is returned , At this time, the data of the table is overwritten by the result of the first request This leads to the mismatch between the filtering results and the filtering keywords

And it eventually led to this bug

The most intuitive solution is to launch a second request , If the first request does not return , Just cancel the request , Use the return result of the second request .

原网站

版权声明
本文为[Grumpy plums are rotten Online]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/185/202207042047311462.html