File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
source code/TestDebugASPNET/pages Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 191191 let urlApi = " /apiProgressReport2" ;
192192 let intervalTimer = null ;
193193 let networkErrorCount = 0 ;
194+ let api_call_index = 0 ;
194195
195196 async function startBackup () {
196197
292293
293294 async function getStatus () {
294295 try {
296+ // increment the api call index
297+ api_call_index++ ;
298+
295299 const formData = new FormData ();
296300 formData .append (" action" , " get_status" );
297301 formData .append (" taskid" , currentTaskId);
302+ formData .append (" api_call_index" , api_call_index);
298303
299304 const result = await fetch (urlApi, {
300305 method: " POST" ,
304309
305310 if (result .ok ) {
306311 let jsonObject = await result .json ();
312+
313+ if (jsonObject .api_call_index != api_call_index) {
314+ // late echo, ignore
315+ return ;
316+ }
317+
307318 updateUiValues (jsonObject);
308319 }
309320 else {
You can’t perform that action at this time.
0 commit comments