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:
And here I am trying to read from https://services.odata.org/V2/OData/OData.svc/
After debugging I have identified where the difference is: https://openui5.hana.ondemand.com/resources/sap/ui/thirdparty/datajs.js
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.
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}"