ChannelFinder / pvinfo

Web interface to channel finder with integrations to other HLC apps
MIT License
11 stars 3 forks source link

monitor all updates #35

Closed tynanford closed 1 year ago

tynanford commented 1 year ago

Found that placing each value update in it's own child component significantly improves the web socket load times and the overall performance of the app.

Using the pattern described here in option 3 to share a single web socket connection and filter the incoming messages in each child component https://github.com/robtaussig/react-use-websocket/issues/40#issuecomment-616676102

Still some warnings in the react app about slow loading setInterval, message, setTimeout, etc but overall the app is fine from a user perspective now on the dev server

tynanford commented 1 year ago

Also the updated logic here fixes two other issues:

Web socket data sticking around since the clear message and clearing the pvValues array happened before all the WS messages were done coming in https://github.com/ChannelFinder/pvinfo/issues/20

Also now if USE_PVWS is false in the .env, there should be no attempts to create a web socket connection and no checkboxes in the query results table