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

Reports unresponsive #1331

Open
jcardus opened this issue Feb 7, 2025 · 11 comments
Open

Reports unresponsive #1331

jcardus opened this issue Feb 7, 2025 · 11 comments

Comments

@jcardus
Copy link
Contributor

jcardus commented Feb 7, 2025

The reports components are re-rendered each time we receive a message in the websocket.

The report page becomes very unresponsive if we generate a report with hundreds of rows (like route report) and we have enough devices on the user to receive updates frequently.

One possible solution to avoid the page from being unresponsive would be to pause the websocket in the reports page and resume when we go back to the map.

Any ideas?

@tananaev
Copy link
Member

tananaev commented Feb 7, 2025

Why is it re-rendered?

@jcardus
Copy link
Contributor Author

jcardus commented Feb 7, 2025

probably because of the devices dependency from the state

@tananaev
Copy link
Member

tananaev commented Feb 7, 2025

I guess it makes sense, but it practice it's shouldn't be a problem because nothing really change on the page. What exactly is causing the unresponsiveness? How many records do you have in the report?

@jcardus
Copy link
Contributor Author

jcardus commented Feb 7, 2025

What's causing the unresponsiveness is the re-rendering. It's not only related to the number of records, it's about number of records / number of devices in the user.

One example, 100 devices in the user, a report with 700 records.

@tananaev
Copy link
Member

tananaev commented Feb 7, 2025

Only device status is updated live. Maybe we can separate device status into its own store. That way it shouldn't be re-rendered.

@jcardus
Copy link
Contributor Author

jcardus commented Feb 11, 2025

You mean something like creating a deviceStatuses array in the store and reference it when we need it? Then the status and lastUpdate fields would be duplicated.

@tananaev
Copy link
Member

Something like that.

@jcardus
Copy link
Contributor Author

jcardus commented Feb 11, 2025

Wouldn't it be easier to just remove the socketcontroller from the reports page?

@tananaev
Copy link
Member

Easier, but it means you will lose notifications.

@jcardus
Copy link
Contributor Author

jcardus commented Feb 12, 2025

Ok, we can put a parameter in the controller so that when we are in reports it doesn't process devices. When we move away it would reconnect so we get the last positions / devices again.

@tananaev
Copy link
Member

I think that's fixing the symptom, not the root cause.

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