0
votes

I have an error on Chrome during the processing of a batch's response. I have tried on Firefox, Edge and Chromium and there is an error only on Chrome with the last version. On this Example I am using my own local OData server:

enter image description here

And here I am trying to read from https://services.odata.org/V2/OData/OData.svc/ enter image description here

After debugging I have identified where the difference is: https://openui5.hana.ondemand.com/resources/sap/ui/thirdparty/datajs.js

enter image description here

I have compared Chrome and Edge and I have noticed that the difference is on the header and how it's read. First you can see the attribue x.headers from Edge and under from Chrome. On Edge the header doesn't contain application/json. I have debugged and removed the rest on Chrome so it looks like Edge and it works then.

enter image description here

The BATCH it self looks like this:

--batchresponse_678d942c-694d-45a8-80ea-9174b251f69b
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 200 OK
Cache-Control: no-cache
DataServiceVersion: 2.0;
Content-Type: text/plain;charset=utf-8

3
--batchresponse_678d942c-694d-45a8-80ea-9174b251f69b
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 200 OK
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/json;charset=utf-8

{
"d" : [
{
"__metadata": {
"uri": "https://services.odata.org/V2/OData/OData.svc/Categories(0)", "type": "ODataDemo.Category"
}, "ID": 0, "Name": "Food", "Products": {
"__deferred": {
"uri": "https://services.odata.org/V2/OData/OData.svc/Categories(0)/Products"
}
}
}, {
"__metadata": {
"uri": "https://services.odata.org/V2/OData/OData.svc/Categories(1)", "type": "ODataDemo.Category"
}, "ID": 1, "Name": "Beverages", "Products": {
"__deferred": {
"uri": "https://services.odata.org/V2/OData/OData.svc/Categories(1)/Products"
}
}
}, {
"__metadata": {
"uri": "https://services.odata.org/V2/OData/OData.svc/Categories(2)", "type": "ODataDemo.Category"
}, "ID": 2, "Name": "Electronics", "Products": {
"__deferred": {
"uri": "https://services.odata.org/V2/OData/OData.svc/Categories(2)/Products"
}
}
}
]
}
--batchresponse_678d942c-694d-45a8-80ea-9174b251f69b--

[UPDATE]

So, this is getting stranger. I just found out that in Chrome it works in Incognito mode but not on normal mode. I tried with Northwind and it's the same. It work's only on Incognito mode. I am using the latest version of UI5 from https://openui5.hana.ondemand.com/resources/sap-ui-core.js and I am using the template from https://github.com/SAP/openui5-masterdetail-app.

I am using Version 88.0.4324.150 of Chrome and I have also tried deleting the Cache

In openui5-masterdail-app I have only modified the oData service:

"uri": "https://cors-anywhere.herokuapp.com/https://services.odata.org/V2/OData/OData.svc/",

and

Master.view.xml

<List
                id="list"
                width="auto"
                class="sapFDynamicPageAlignContent"
                items="{
                    path: '/Suppliers'
                }"


<items>
                    <ObjectListItem
                    title="{Name}"
1
Does this happen also with the Northwind service? With which UI5 version are you working? Also the question is missing some code / mcve. Without it, it's difficult to help.Boghyon Hoffmann
What is the version if your chrome? We are having problems with the PDFViewer in Edge v90, so this might be a bigger problem.Marc
@BoghyonHoffmann thanks for yout tip. I have updated the question.PeDeGa
@Marc I have updated the question. Can you try if you have the problem in Incognito Mode of Edge too?PeDeGa
I think there are multiple factors leading to this issue in the question. I'd suggest to choose a different, a better maintained OData service (e.g. one of the services from SAP ES5 system), and to avoid cors-anywhere but use documented guidelines as mentioned in stackoverflow.com/a/53878337/5846045Boghyon Hoffmann

1 Answers

0
votes

Just checking this possibility - Extensions.

Do you have any extensions (eg: like AdBlocker - Not saying Adblocker is the culprit.. but similar way of working), which may intercept the payload coming back?

To rule this out, do the following:

  • In chrome, create a new profile/account - without ANY extensions.
  • Switch to that account, and try running the app.
  • If it works, come back to your original account, and start disabling extensions one by one - to figure out which exactly may be the issue.

Again, I am not 100% sure, if extensions are the exact problem here - but I have had this as the problem in some of the apps I built. Hence, worth a try - especially the first step of creating a new profile without any extensions, and testing would be a quick one.

Best Regards, Gopal Nair.