Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling network connection error with SeverPush active #102

Open
nzanaga opened this issue Jan 23, 2023 · 7 comments
Open

Handling network connection error with SeverPush active #102

nzanaga opened this issue Jan 23, 2023 · 7 comments
Labels
question Further information is requested

Comments

@nzanaga
Copy link

nzanaga commented Jan 23, 2023

I suppose that not all exceptions are handled when using 'Request_sendWithFetch' , I found problems when 'ServerPush' is active,
sometimes retry is working and sometimes no.

I have modified "Request_sendWithFetch" adding try .. catch inside entire function and inside every 'then' and it seems to work fine.

This is, for example, an uncaught error:

image

@ifurnadjiev
Copy link
Contributor

Can you tell some simple steps to reproduce the issue?

@ifurnadjiev
Copy link
Contributor

What action did you perform in order to provoke ERR_CONNECTION_RESET error?

@ifurnadjiev
Copy link
Contributor

BTW... which RAP version is used for your testing?

@ifurnadjiev ifurnadjiev added the question Further information is requested label Jan 24, 2023
@nzanaga
Copy link
Author

nzanaga commented Jan 24, 2023

I'm using 3.24.0-M1 version

For testing I do:

  • start a RAP application on my pc (windows 10)
  • start a virtual machine with "Oracle VM VirtualBox" (windows 10)
  • from virtual machine open Edge (or Chrome or Firefox) browser and point to host machine
  • while application is running and browser is open, disable / enable virtual machine network card
    reply this action many times and each time keep network disabled for few time or long time
    while the network is disabled try both without doing anything on the browser and by performing activities on the browser (making the error message appear immediately)

I have done some tests, with PushSession active or not, and watching the error on the browser console I see the error is not always the same, the most commons are:
net::ERR_ADDRESS_UNREACHABLE
net::ERR_INTERNET_DISCONNECTED
net::ERR_CONNECTION_RESET

and sometimes also the error above.

To do a better test, I also have increase 'ServerPush.js' retry time to prevent error message box from popping up too soon
(by the way I think ServerPush should be do a continuos call without break with message if user do nothing while network is down)

Here the modified code in 'ServerPush.js' '_handleError'

  if( this._retryCount < 1000 ) {
	this._retryCount++;  
    var delay = (this._retryCount <= 5) ? 1000 : 3000;
    rwt.client.Timer.once( this.sendServerPushRequest, this, delay );
  } else {
    this._handleConnectionError();
  }

@ifurnadjiev
Copy link
Contributor

Could you try tomorrow with the RAP nightly build. I fixed the other two issues reported by you and I think that they are related.

@nzanaga
Copy link
Author

nzanaga commented Jan 26, 2023

In "Request.js" method "_sendWithFetch" there is a ".catch" only in the first ".then" command

Should be added ".catch" after every ".then" to prevent uncaught errors

@ifurnadjiev
Copy link
Contributor

I don't think this is needed. The outer ".catch" should catch all the errors thrown internally by "fetch" and ".then". More over the second Promise is for getting the response text which should never throw.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants