Yesterday I was challenged by my colleague: in the CRM Fiori application “My Opportunity”, although the OData request for logo url is set as false ( means Synchronous ), why we still observe in UI that this request is done like Asynchronously?

/wp-content/uploads/2015/06/clipboard1_728876.png

For the complete story about Image display logic in Fiori, please refer to this blog: CRM Fiori Application – how is image maintained and displayed in Fiori UI.

My colleague’s doubt is that he observed even the response of image url is not returned by backend, still end user could continue to work on UI – it seems UI is not blocked so my colleague considered that the request is done in an Asynchronous way.

/wp-content/uploads/2015/06/clipboard2_728877.png

I just would like to share with you how I persuade him to accept this is really an Synchronous request.

The key idea here is: We are doing test in our internal system, the request for image url is almost immediately returned ( less than 2 seconds ), so it is really difficult to judge by eye whether it is synchronous or asynchronous.

As a result, I add another 13 seconds’ latency in OData service implementation:

/wp-content/uploads/2015/06/clipboard3_728878.png

Synchronous mode

Afterwards the synchronous behavior is quite obvious now. I click one item in navigation list to trigger the synchronous request for Image url retrieval. And after that, I cannot do any operation on UI – it is completely freezed.

/wp-content/uploads/2015/06/clipboard4_728879.png

Please refer to blocked UI behavior from this video.

Asynchronous mode

Then I change the manual latency to 20 seconds and retest the UI.

Now every time I click one opportunity in the navigation list, still one http request for image logo is sent out. Compared with synchronous mode, this time the UI is not blocked – I can continue to work on UI without waiting for the response.

This asynchronous behavior could also easily be found in the timechart in Chrome network:

/wp-content/uploads/2015/06/clipboard5_728880.png

Please refer to asynchronous UI behavior from this video.

Conclusion

code is correct, our eye is wrong. Any OData request with async set as false, would and must be done synchronously.

/wp-content/uploads/2015/06/clipboard6_728881.png

Further reading – A list of my debugging posts

I have written a collection of blogs which contains my experience how to resolve some issue or figure out the logic of UI5 framework under the hood via self-debugging. See a list below:
To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. Momen Allouh

    Thanks that’s solved my frozen custom loading indicator process bar.

     

    Also i noticed that property ( async: true ) is missing from oData model v2 ( sap.ui.model.odata.v2 ) it is only available in oData version 1.

     

    any way i don’t know if v2 is supported by sap netwaver gateway or what else is in v2 instead of async property.

     

     

    (0) 

Leave a Reply