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

Things get rendered twice #3103

Open
benfrancis opened this issue Aug 16, 2023 · 2 comments · May be fixed by #3107
Open

Things get rendered twice #3103

benfrancis opened this issue Aug 16, 2023 · 2 comments · May be fixed by #3107
Labels
Milestone

Comments

@benfrancis
Copy link
Member

When debugging the gateway front end I have noticed when that when the Things screen is loaded, the collection of Things is actually rendered twice. Each Thing is rendered in turn, then the view is cleared, then they are rendered again.

I also note that the /things resource is fetched three times, and /groups twice. Something is causing a refresh during page load.

STR:

  • Load /things

Expected:

  • /things and /groups resources loaded once
  • Things rendered once

Actual:

  • /things resource loaded three times
  • /groups resource loaded twice
  • Things rendered twice
@benfrancis benfrancis added the bug label Aug 16, 2023
@benfrancis benfrancis added this to the 1.2 milestone Aug 16, 2023
@benfrancis
Copy link
Member Author

I also note that on the thing detail view, the Thing gets rendered twice.

@benfrancis
Copy link
Member Author

Ah, I've narrowed this down to https://github.com/WebThingsIO/gateway/blob/master/static/js/models/gateway-model.js#L149

refreshThings() is called both when the /things WebSocket is opened, and when the /groups WebSocket is opened.

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

Successfully merging a pull request may close this issue.

1 participant