cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shazron <>
Subject [All Platforms][CordovaJS] NO_RESULT handling
Date Mon, 24 Nov 2014 22:59:40 GMT

What I am discussing requires a change in cordova.js that will affect
all platforms.

NO_RESULT (integer:0) is treated as success by iOS [1] and Android [2].

On Android, NO_RESULT is not processed on the JS layer if keepCallback
is true [3]
while on iOS it is always sent.

In cordova.js, lines 203-207 [4] seem to imply that you would only
call the success callback if the status was OK. However, the logic in
it, would send a failure callback for NO_RESULT (which is a

I believe the intent was this pseudo-code:

if (success) {
    if (status is OK) {
        // call success callback
    } else {
        // do nothing, NO_RESULT (success)
} else {
    // call fail callback


However, I think if it was NO_RESULT, shouldn't it call the success
callback anyway since it was a success? Or is NO_RESULT expected to
not call any callback? I don't know the answer to this, nor could I
find any docs to suggest that is the way it is. I think we need to be
consistent on the behaviour of the NO_RESULT status code, with minimal
impact to existing plugin code.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message