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

websockets not closing correctly? #59

Closed
algar42 opened this issue Nov 29, 2019 · 6 comments
Closed

websockets not closing correctly? #59

algar42 opened this issue Nov 29, 2019 · 6 comments
Labels

Comments

@algar42
Copy link
Contributor

algar42 commented Nov 29, 2019

Describe the bug
Everything works fine until we close and re-open browser or open front-end from another device. In this case it looks like the previous ws client is not destroyed and server continue to broadcast to closed connections. As a result with each new connection we get increasing number of data sent to the clients and states update on page reload and/or on another device stop working...

To Reproduce

  1. Restart lovelace adapter and open front-end.. at this step everything should work fine even if we just reload the page.
  2. Close browser completely -> run browser -> open front-end again.
    At this stage
    a) on page reload we get old data (looks like connection with new client does not init correctly).
    b) we start getting duplicated state_updates from server, i.e. server sends data to the closed connection from point 1.
    Here at the picture only one front-end opened, but states are duplicated:
    image

If can't repeat the issue, try to re-load page/ re-open browser couple of times.. at some point you'll see it

@algar42
Copy link
Contributor Author

algar42 commented Dec 6, 2019

Not fixed. Behavior still the same with v1.0.6. Strange things start happen after call of onObjectChange().
to reproduce:

  1. create manual entity of any type
  2. restart adapter
  3. open frontend - at this point everything is Ok
  4. Initiate onObjectChange - e.g. change any object in system or even simple open an 'Overview' page in iobroker admin and press ctrl+R (reload of this page changes some system objects and makes lovelace adapter to call onObjectChange )
  5. look at WS. you should start receiving two updates of manually created entity. Each onObjectChange will increase the number of WS updates for this entity.

Also, after the steps above, changes made to any controls in frontend are no longer stored.. e.g. try to change anything (turn off light) and reload the page.

@GermanBluefox
Copy link
Contributor

Sorry I cannot reproduce your behavior.
May you can deliver me logs with debig level?

@algar42
Copy link
Contributor Author

algar42 commented Dec 8, 2019

here is the log from adapter restart until second update of objects https://pastebin.com/CmnjpkpY
and here is the screen recording, where after first start everything is Ok, but after objects updated second time we start getting duplicated messages: https://photos.app.goo.gl/32MPYSGScRzEkTid9

@modsfabio
Copy link

I'm having the same issue..
ioBroker/ioBroker.js-controller#615

@modsfabio
Copy link

modsfabio commented Jan 26, 2020

Are there any news on this topic?.. Lovelace is unusable..

@algar42 @GermanBluefox @Apollon77

@algar42
Copy link
Contributor Author

algar42 commented Feb 9, 2020

This seems to be fixed in PR and https://github.com/algar42/ioBroker.lovelace

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

No branches or pull requests

3 participants