AppWarp Sessions Not Ending (Xamarin)

0 votes
Hello,

I am developing an application for iOS and Android using Xamarin and AppWarp and I am having issues with disconnecting and ending sessions properly.

The first problem is that the Disconnect() method does not work in the AppWarp Xamarin library (see: http://forum.shephertz.com/?qa=6532/appwarp-xamarin-unable-to-disconnect).

The second issue is pretty rare but with Connection Resiliency enabld sometimes my sessions do not end for a long time. At this moment I am not running my app anywhere and I haven't for quite a while but if I look at the management console online I see that there are 3 CCU's which doesn't make any sense. As a result I am unable to connect as one of the live users because I always get an AUTH_ERROR even though it has been well past the recovery period since the user was last connected. Can someone help me fix this issue? I feel like it can't be a problem with my code since no matter what if I stop running the app the session should end after the Recovery period expires so it is most likely a server issue or something with how the Xamarin AppWarp Library sets up a session with Connection Resiliency incorrectly.

If I disable Connection Resiliency the session is ended as soon as the app closes as you would expect.

Also, is there a way to possibly see the connected usernames and end the sessions manually using the Management Console online because my app always says there is 1 CCU and I can't figure out how to end that session (I don't even know what the username is)?

Thanks!
asked Nov 3, 2015 in AppWarp by feraask (45 points)
edited Nov 8, 2015 by feraask

1 Answer

0 votes
Hello Feraask,

Thanks for sharing the details with us.

When you login to AppHQ Management Console, you get connected to the AppWarp as admin user to get the necessary details and hence it shows 1 CCU.

Regarding the auth_error, you are getting this error code in response of recoverConnection API or Connect API.?

Thanks.
answered Nov 4, 2015 by rajeev.etc (1,660 points)
I get it when I try to connect again after closing the app, waiting for the recovery period to expire, then opening the app again and trying to login. I can recover the session using the RecoverConnection() API if I save the session ID locally before closing the app but if I want to login to the same account on a different device I never can since that device doesn't have the session ID store locally and the session on the server does not end for a long time.
Hi Feraask,

Thanks for sharing the details.
Which device you are using to test the app? You are sending app to background or terminating it when issue comes. Please let me know these details, it will help to debug the problem.
I am trying to replicate the issue at my end and will update you for the same as soon as possible.

Thanks.
Hi Feraask,

I tried to replicate the issue at my end but it is not happening.
Could you please share your project on support@shephertz.com?
It will help to provide better support from my end.

Thanks.
I have created a test app that demonstrates the Disconnect bug I mentioned, you simply need to put in the apiKey and secretKey inside the AppServices.cs file in the AppWarpTest_PCL project. Then run the app and hit connect and wait for the Connected Successfully message to show up and then try to disconnect and it does not work.

As for the session not ending the problem is that it doesn't happen all the time so it has been very difficult for me to track down the exact sequence of events that is causing it to happen. But I am using Xamarin Studio 5.9.8 (Build 0) on a Mac running OS X 10.11.1 El Capitan using the iOS Simulator running iOS 9.1 and an actual Android device running Android 5.0.2 Lollipop. Basically I will be running the app in the iOS Simulator and Connect fine then I hit the stop button in Xamarin Studio (no disconnect or anything) and then I wait for a minute and try to Connect as the same user on the android device which doesn't have the session ID saved (so it can't recover the session) and I will get an AUTH_ERROR for a long time (I'm not sure exactly how long the sessions eventually end but it's definitely way more than the 30 second recovery period I have set). Now if I try to RecoverConnectionWithSessionID on the iOS Simulator that works fine so that seems to me that the session never ended. If I get rid of the stored SessionID on the iOS Simulator then it also will fail to Connect.

The next time it happens I'll try to look at exactly what I was doing before and see if I can consistently replicate it and report back to here.

Anyway for now if you guys could just fix the disconnect issue that would be great here is the test app for that simply demonstrates the disconnect issue:
https://bitbucket.org/feraask/appwarptest_xamarin_pcl/get/5f7c0f5fed8f.zip

Thanks!
Hi Feraask,
Thanks for sharing the sample project.
We are looking into it and will update you on the same asap.
Thanks.
Have you guys made any progress on fixing the disconnect issue?
Hello Feraask,

Please download the updated dll from here(https://www.dropbox.com/s/701y8yjuqr48gwq/AppWarpMonoLibrary.dll?dl=0) and let us know if you still face any issue.

Regards,
Rajeev
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on support@shephertz.com
...