Progress dialog not showing on each statement and request

Hello, I’m trying to process some information from a data table using a specific data attribute, I hvae to find all the elements and then show a dialog showing how many items are there and which one is being processed, (processing 1 of 8 for example), I need to validate them and then send them to the server using app.request. the problem is that the dialog is not showing at all, here’s the code:

    function submitItemsByLoc () {
   let totalElements = $$("[data-location-row]").length;

   if (totalElements === 0) {
      app.methods.alertMessage(language.Errors.emptyLocation, language.Placeholders.errorTitle);
      return;
   }

   let loc = '',
      count = 0,
      current = 0,
      partNumber = '',
      error = 0,
      process = true,
      countInput,
      variance = 0,
      minCount = 0,
      maxCount = 0,
      leMessage = '',
      elementId = '',
      currentElement = 0;

   loc = $$('#listLocation').html();
   var dialog = app.dialog.progress('Loading assets', currentElement);

   $$('.locCountBody').find('[data-location-row]').each( function() {
      currentElement +=1;
      dialog.setProgress((currentElement*100)/totalElements);
      dialog.setText('Sending Part number ' + currentElement + ' of '+ totalElements);
....
      setOnHand(count, partNumber, loc, elementId); //calls to the app.request method
  });

When debugging on a web browser it shows (using breakpoints), but if I run it normally it won’t appear. I’m using async:true in my calls, I tried to change it to false bit still didn’t work.

any ideas?