Loading dissmiss not working randomly

Sometimes the loading dismiss just not closes.

Can you provide a code example?

import {NavController, Loading} 		 from 'ionic-angular';

  	loadData(){
    		let loading = Loading.create({
    			content: 'Wait a moment...'
    		})
    		this.nav.present(loading);

    		this.awsProvider.getAwsData().then((result: any)=>{
    			this.documentos = result.docs;
    			loading.dismiss();
      		}).catch((error)=>{  			
      			console.error('Error retrievind documents, JSON.stringify(error, null, 4));
      			loading.dismiss();
      		});
    	}

getAwsData always works. I know because the result is shown in the screen even if the loading don’t closes.

It seems the loading is getting lost before a screen change. I discovered the loading with problem is from the last screen, not the current one.

A workaround to solve this problem can be to put the screen transition inside an setIntervel just after the loading.dismiss().