sap-labs-france / ev-dashboard

The Open e-Mobility Charging Station management front-end Angular application (check also ev-server and ev-mobile)
https://open-e-mobility.fr/
Apache License 2.0
67 stars 101 forks source link

Socket.io > Session Chart: The Chargers and Charts are not refreshed when a session is on going on production landscape #1240

Closed LucasBrazi06 closed 4 years ago

LucasBrazi06 commented 4 years ago

Socket IO is active in the prod. Check what would be wrong with it. Thanks!

LucasBrazi06 commented 4 years ago

Issue opened since 2 weeks! Please have a look!

jerome-benoit commented 4 years ago

Preliminary work:

jerome-benoit commented 4 years ago

The CORS issue is not related, it's another issue.

LucasBrazi06 commented 4 years ago

Tested dev locally and it works now. To be tested in QA but need someone who charges his car.

jerome-benoit commented 4 years ago

I do not have changed anything except the socket.io upgrade. And the code to refresh charts seems to do the right thing.

LucasBrazi06 commented 4 years ago

I do not have changed anything except the socket.io upgrade. And the code to refresh charts seems to do the right thing.

Ok, let's assume it was a false positive then :-)

LucasBrazi06 commented 4 years ago

We still have the issue in prod (tested today)

fcoutellier commented 4 years ago

image

LucasBrazi06 commented 4 years ago

Check all the screens (eg. when I activate auto refresh in the logs it's not working either)

jerome-benoit commented 4 years ago

@fcoutellier Can you please do some testing?

I do not have changed anything and during all my last week tests through mitmproxy, it's been working fine.

fcoutellier commented 4 years ago

@jerome-benoit Serge reported me that during a test with Seb 2 opened web browser were opened and only one of them was connected to socket IO and refreshing the charging curve automatically.

jerome-benoit commented 4 years ago

@jerome-benoit https://github.com/jerome-benoit Serge reported me that during a test with Seb 2 opened web browser were opened and only one of them was connected to socket IO and refreshing the charging curve automatically.

Two opened windows or tabs of the same browser? Because it’s not the same in the processus parenting.

And two windows, one for two different browser, are working fine?

-- Jérôme Benoit aka fraggle Piment Noir - https://piment-noir.org OpenPGP Key ID : 27B535D3 Key fingerprint : B799 BBF6 8EC8 911B B8D7 CDBC C3B1 92C6 27B5 35D3

LucasBrazi06 commented 4 years ago

@jerome-benoit https://github.com/jerome-benoit Serge reported me that during a test with Seb 2 opened web browser were opened and only one of them was connected to socket IO and refreshing the charging curve automatically. Two opened windows or tabs of the same browser? Because it’s not the same in the processus parenting. And two windows, one for two different browser, are working fine?

Two differents Chrome browsers

LucasBrazi06 commented 4 years ago

We have the issue reported by Frank @SAP reception desk, also not working in the giant iPad. You could have a look at it this afternoon.

LucasBrazi06 commented 4 years ago

god-prio ;-)

jerome-benoit commented 4 years ago

The bug reproducibility is still not evident even given all the usage patterns listed in that issue, so goes its resolution. On the Giant iPad, it seems 100% reproducible. So appointment will be taken with the IT in order to work on it with a mouse and a keyboard.

jerome-benoit commented 4 years ago

I think I've narrowed down that issue with the debug logs:

The socket.io initialisation is only done after a login phase because of the need to authorise it with the Jwt token. But when you already have a Jwt token on your browser, the login function is not called again and the socket.io initialisation is not done. I will try to hook it in the dashboard init if there's already a Jwt token referenced in the browser.

LucasBrazi06 commented 4 years ago

I think I've narrowed down that issue with the debug logs:

The socket.io initialisation is only done after a login phase because of the need to authorise it with the Jwt token. But when you already have a Jwt token on your browser, the login function is not called again and the socket.io initialisation is not done. I will try to hook it in the dashboard init if there's already a Jwt token.

Excellent ! Let's see if it'll work out after this fix.

jerome-benoit commented 4 years ago

The socket.io initialisation is only done after a login phase because of the need to authorise it with the Jwt token. But when you already have a Jwt token on your browser, the login function is not called again and the socket.io initialisation is not done. I will try to hook it in the dashboard init if there's already a Jwt token.

Excellent ! Let's see if it'll work out after this fix.

So far so good: always one socket.io connection per browser tab to refresh each tab, socket.io reconnect successfully on a per browser tab basis whatever is the number of browsers and tabs opened.

I still think that at some point to avoid to overload the rest services because of socket.io, the socket.io server will need to be split out but that's not before an important usage of the dashboard.

LucasBrazi06 commented 4 years ago

So far so good: always one socket.io connection per browser tab to refresh each tab, socket.io reconnect successfully on a per browser tab basis whatever is the number of browsers and tabs opened.

I still think that at some point to avoid to overload the rest services because of socket.io, the socket.io server will need to be split out but that not before an important usage of the dashboard.

Ok thank you. Yes we'll split it when we'll have million users :-)

jerome-benoit commented 4 years ago

The issue is back on production SCP landscape only. It works everywhere else.

jerome-benoit commented 4 years ago

And now, it works correctly again on the production landscape.

Next time, maybe try to restart the REST application to see if it fix it or not.

LucasBrazi06 commented 4 years ago

And now, it works correctly again on the production landscape.

Next time, maybe try to restart the REST application to see if it fix it or not.

Weird anyway !

fcoutellier commented 4 years ago

I close this issue and will reopen a new one later one if necessary