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

Signal R not reconnects and getting random errors after some ideal time. #138

Open
rahulraibit opened this issue May 28, 2019 · 1 comment

Comments

@rahulraibit
Copy link

Hi There, I am using this library, it works well but I am facing some random issue which keeps coming after 40 to 45 min of ideal time.

Scenario 1. If I will disconnect the network for 40 to 45 min then in my application I get the below error.

main.07ea5b4b6aca92fa3441.js:1 listener next() called. main.07ea5b4b6aca92fa3441.js:1 Object 4 main.07ea5b4b6aca92fa3441.js:1 Object 3 main.07ea5b4b6aca92fa3441.js:1 Object 2 main.07ea5b4b6aca92fa3441.js:1 Object 2 main.07ea5b4b6aca92fa3441.js:1 Object 2 main.07ea5b4b6aca92fa3441.js:1 SignalRConnection.proxy.on invoked. Calling listener next() ... main.07ea5b4b6aca92fa3441.js:1 New event Array(2) main.07ea5b4b6aca92fa3441.js:1 listener next() called. main.07ea5b4b6aca92fa3441.js:1 SignalRConnection.proxy.on invoked. Calling listener next() ... main.07ea5b4b6aca92fa3441.js:1 New event Array(2) main.07ea5b4b6aca92fa3441.js:1 listener next() called. main.07ea5b4b6aca92fa3441.js:1 Object 2 main.07ea5b4b6aca92fa3441.js:1 SignalRConnection.proxy.on invoked. Calling listener next() ... main.07ea5b4b6aca92fa3441.js:1 New event Array(2) main.07ea5b4b6aca92fa3441.js:1 listener next() called. main.07ea5b4b6aca92fa3441.js:1 Error SignalR Error: The client has been inactive since Fri May 24 2019 16:11:04 GMT+0530 (India Standard Time) and it has exceeded the inactivity timeout of 50000 ms. Stopping the connection.

Scenario 2. Not sure why but sometimes I have observed that I also get the below errors even if my system is connected to the internet all the times.

t.handleError @ main.07ea5b4b6aca92fa3441.js:1 main.07ea5b4b6aca92fa3441.js:1 Error: Uncaught (in promise): Error: SignalR: Connection must be started before data can be sent. Call .start() before .send() Error: SignalR: Connection must be started before data can be sent. Call .start() before .send() at init.send (scripts.9a12937328252374e408.js:1) at init.invoke (scripts.9a12937328252374e408.js:1) at main.07ea5b4b6aca92fa3441.js:1 at new e (polyfills.a69b3298b70e1661b3fc.js:1)

I want to understand if anyone has faced a similar issue and if yes how to solve it. Also, let me tell you that for reconnect I am subscribing on status change and on disconnect I am trying to connect to signal r here is my below code.

const conx = this.signalR.createConnection(); conx.status.subscribe((s) => { // Connect the Signal R if its disconnected if (s['name'] === 'disconnected') { setTimeout(() => { this.adalService.acquireToken(this.acquireTokenurl).subscribe( token => { if (token) { this.connectSignalR(conx, token); } }); }, signalConnectionRetry); } });

@RajakumarSidhan
Copy link

I m also running in to similar issue.
ERROR Error: Uncaught (in promise): Error: SignalR: Connection must be started before data can be sent. Call .start() before .send()
Error: SignalR: Connection must be started before data can be sent. Call .start() before .send()
at hubConnection.fn.init.send (node_modules\signalr\jquery.signalR.js:871:1)
at init.invoke (node_modules\signalr\jquery.signalR.js:2952:1)
at ng2-signalr.js:183:1
at new ZoneAwarePromise (zone.js:1349:1)
at SignalRConnection.invoke (ng2-signalr.js:182:1)

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

No branches or pull requests

2 participants