OData / AspNetCoreOData

ASP.NET Core OData: A server library built upon ODataLib and ASP.NET Core
Other
454 stars 159 forks source link

Microsoft.AspNet.OData NuGet Package Upgrade Causing delay in the Functionality #1264

Open Akhil4025 opened 3 months ago

Akhil4025 commented 3 months ago

Hi,

I have upgraded Microsoft.AspNet.OData NuGet Package in our application from 7.5.14 to 7.7.5 and since then it is causing delay in few of the Api calls in the application. Before upgrade everything works fine without causing any delay. The scenario is same when I upgrade the same package to 7.6.0 and above versions.

Please advise if anyone knows the root cause of this behavior.

julealgon commented 3 months ago

@Akhil4025 you will need to provide more detail than this. Can you repro the issue, maybe create a small sample that reproduces the slowdown?

habbes commented 3 months ago

@Akhil4025 could you share more information about the affected scenarios? Like @julealgon mentioned, a small sample that reproduces the issue would be great.

Akhil4025 commented 3 months ago

Below is the code from .js file which is calling the Server side API.

var userNotificationFlag = { "userID": $rootScope.userID, "subscribeToNotificationFlag": value, };

return $http({ method: 'POST', url: ApiUrl + 'Users', data: userNotificationFlag }).then(function (data) { if (userData) { userData = angular.copy(userData); userData.notificationsOn = value; }

Below is the Server Side API which is being called

[HttpPost] public HttpResponseMessage Post([FromBody] Delta userPost) { }

The delay is happening when the control is trying to reach from .js code to .net code that I have mentioned above.

This is how our sever side code is being configured

WebApiConfig.cs: EntitySetConfiguration userEntity = builder.EntitySet("Users");

Global.asax.cs: protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); }

Akhil4025 commented 2 months ago

And I tried to pass --> $rootScope.userID as the data alone after Odata upgrade Instead of

**var userNotificationFlag = {

"userID": $rootScope.userID,

"subscribeToNotificationFlag": value,

};**

and I observed that API call is quick as it was before the upgrade of Odata package. I'm not sure how the parameters are causing the issue after Odata upgrade.