Bug 26678 - After updating to XA 4.20 the call to ODataservice never returns
Summary: After updating to XA 4.20 the call to ODataservice never returns
Status: NEEDINFO
Alias: None
Product: Android
Classification: Xamarin
Component: General (show other bugs)
Version: 4.20.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-02-03 05:12 UTC by Prashant Cholachagudda
Modified: 2016-11-11 09:56 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Testcase (446.68 KB, application/zip)
2015-02-03 05:12 UTC, Prashant Cholachagudda
Details

Description Prashant Cholachagudda 2015-02-03 05:12:00 UTC
Created attachment 9618 [details]
Testcase

Since updating to the latest Xamarin install call to ODataservice returns from the data service nor does it timeout.

If we reference the same Data service DLL (PCL Class Library) from within a Windows Phone project it all works fine. I have attached a small project with the data service DLL referenced by both an Xamarin Android and Windows Phone project demonstrating the problem

In the Android App a test method called Testing() is called in the Activity Create to test the issue.
Comment 2 asimk 2015-02-05 12:46:54 UTC
We have checked this issue with the help of testcase given in bug description and observed that when we run the android app then it is working fine, ODataservice returns from the data service and save the changes successfully and with windows phone app we are getting exception 'An unhandled exception of type 'System.AccessViolationException' occurred in DataTestWinPhoneApp.DLL' on line below in method 'Testing()' in App.xaml.cs

result.Results.FirstOrDefault().RemoveOpenOrderItem(result.Results.FirstOrDefault().OpenOrderItems.LastOrDefault());

Screencast : http://www.screencast.com/t/JVPXQITe

Could you please have a look on the screencast and let us know if we missed anything.

Envoronment Info:

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Xamarin   3.9.289.0 (39a70ae)
Comment 3 David Ingrey 2015-02-05 13:10:25 UTC
Use this for the testing method on Windows Phone

private async void Testing()
        {
            DateTime tradingDate = new DateTime(2015, 1, 20);

            IThreading test = new WindowsPhoneDispatcherHelper();

            IDataSource dataService = new AsyncODataSource("http://23.23.201.163/MobileDataServiceTesting/", new NetworkConnection(), new WindowsPhoneDispatcherHelper());
            
            //var result = await dataService.LoadOrder(254, 100031, tradingDate, false);
            //var result = await dataService.LoadOrder(255, 100031, tradingDate, false);
            var result = await dataService.LoadOrder(256, 100031, tradingDate, false);
            //var result = await dataService.LoadOrder(257, 100031, tradingDate, false);
            //var result = await dataService.LoadOrder(258, 100031, tradingDate, false);
            //var result = await dataService.LoadOrder(259, 100031, tradingDate, false);
            //var result = await dataService.LoadOrder(260, 100031, tradingDate, false);
            //var result = await dataService.LoadOrder(261, 100031, tradingDate, false);

            test.CheckBeginInvokeOnUI(async () =>
                {
                    if (!result.HasError)
                    {
                        result.Results.FirstOrDefault().RemoveOpenOrderItem(result.Results.FirstOrDefault().OpenOrderItems.LastOrDefault());
                        var saveResult = await dataService.SubmitChanges();
                    }
                });
        }
Comment 4 David Ingrey 2015-02-05 13:51:53 UTC
Also I noticed in the ScreenCast that you say the saved worked for Android. If you look closely you will see it processed the await on the submitchanges but the call never returns (This is the issue) there is a break point after the submitchanges.

You will see in the code for the data service it write Save Started to the Output  window but it will also write Save Finished once the async call is returned.

Note You need to log in before you can comment on or make changes to this bug.