Edwin Schravesande6028557
Posts: 0
Joined: Tue Jul 09, 2013 2:44 pm

Succes - Error - Complete, what's the difference. And how to manage access?

Hey there! I'm in the functional design phase of my app. I'm trying to get a good grip on how to manage access.

You suggested (in another thread) to validate the session token by making some kind of call to a REST service. On error we can conclude the user has to re-login. I guess I can manage that. But what if this test fails because the internetconnection fails. Does it return Error too? If so: how could I make a distinction between a failing session-token and a failing Internetconnection? (distinguishing does matter a lot for the user experience I guess).

And what is this event 'Complete' that is the third possible outcome when invoking a REST service. What's the difference with 'Succes'?

Do you have any suggestions / tutorials / documentation to point to, for building a nice process for handling the process of waiting for a returning internetconnection / retrying the service invoked.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Succes - Error - Complete, what's the difference. And how to manage access?

Hello! Please take a look here http://docs.appery.io/documentation/a.... Let me know if you have any other questions.

Edwin Schravesande6028557
Posts: 0
Joined: Tue Jul 09, 2013 2:44 pm

Succes - Error - Complete, what's the difference. And how to manage access?

I should have read that before posting. This does indeed answer my question regarding the difference between succes-error and complete.

But It's still not quite clear how to handle this. Maybe this is sort of a stupid question and I'd better try to find out experimenting, but maybe if you know some answers...
What happens if I invoke a service calling the database, and the internetconnection fails? Does it return (a specific kind of) error, or does it just never complete? Or is there some other kind of time-out event? I

I read via other forum replies about how to actively check the connection status with a cordova command, and I see there's an event 'offline' and 'online' that I could probably use to constantly monitor connection status. But I guess I don't care about the user being offline until the moment he's trying to invoke a service.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Succes - Error - Complete, what's the difference. And how to manage access?

If there is any problems with connection error event is triggered. Complete event triggers always independently on error or success events. It's convenient if you need to do something no matter what result you get).

Return to “Issues”