ConnectionRequest.retry() not working properly?

29 views
Skip to first unread message

mikko.nu...@gmail.com

unread,
Jan 29, 2015, 7:14:34 AM1/29/15
to codenameone...@googlegroups.com
Hi,

I overrode handleErrorResponseCode to my own extended connection request class. The point is to ask from user that "should we go to offline mode or retry connection?" in case of server error. It appears that after clicking the retry button (and after "fixing" the server error cause) the hung connection request is revived fine but next one gets always stuck with infinite "infinite progress" displayed. I also tried the originial implementation without overriding with same result. I'm using synchronous connection requests with addToQueueAndWait() and the old VM.


Shai Almog

unread,
Jan 29, 2015, 10:18:24 AM1/29/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com
Hi,
how are you invoking retry. It should work and should indeed retry.

mikko.nu...@gmail.com

unread,
Jan 29, 2015, 10:33:41 AM1/29/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com
Hi,

like this, from my extended class. And as said it does retry, but the next request after that gets hung. Same thing when using ConnectionRequest's non-overridden version of handleErrorResponseCode().

@Override
protected void handleErrorResponseCode(int code, String message) {
if (Display.isInitialized() && Dialog.show("Error", code + ": " + message, "Retry", "Offline")) {
     
retry();
} else {
     setKilled
(true);
     
StateMachine.setOffline(true);
     
RequestInfo.setRequestStatus(RequestStatus.FAILURE);
     
RequestInfo.setMessage("Failed to connect  server");
}

Shai Almog

unread,
Jan 30, 2015, 1:54:50 AM1/30/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com
Hi,
is this in the simulator or device?
Did you open the network monitor?
Do you see the new request going out?

mikko.nu...@gmail.com

unread,
Jan 30, 2015, 5:26:40 AM1/30/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com
Hello,

Simulator, Android, iOS.
Yes.
No.

Shai Almog

unread,
Jan 30, 2015, 11:35:54 AM1/30/15
to codenameone...@googlegroups.com, mikko.nu...@gmail.com
Can you file an issue on this?
I recall there was a bug there but as far as I recall it was fixed, might be a regression.
Reply all
Reply to author
Forward
0 new messages