stanfordnmbl / opencap-viewer

Apache License 2.0
3 stars 5 forks source link

Subject and session loading Admin #342

Closed antoinefalisse closed 2 months ago

antoinefalisse commented 4 months ago

@olehkorkh-planeks do you have any thoughts?

When logged-in as admin, the web app is lagging because it tries to load data from all session/subjects belonging to all opencap users.

This is related to these lines on the api side:

Having access to all sessions/subjects is however needed on the core side, because we "run" core using the admin token and need to retrieve session info and subject info from the trial being processed:

Could we optimize things on the frontend side such that not everything is being loaded? I believe you did something similar to optimize speed previously. While it is only a problem for admin at this stage, this might become a problem from actual users who have a lot of data.

Here is a video that describes what is happening:

https://drive.google.com/file/d/1ImUu9p2xL4-WfOBT9yHFlvgqZRPJwh_y/view?usp=sharing

olehkorkh-planeks commented 4 months ago

Backend - https://github.com/stanfordnmbl/opencap-api/pull/198/files Frontend - https://github.com/stanfordnmbl/opencap-viewer/pull/347/files

antoinefalisse commented 4 months ago

Hi @olehkorkh-planeks,I am still having issues. It says no data available. The console reports some network errors. This all seems related to the subject tags we recently added. Subject tags are not "part" of subjects (see below), so I am guessing that even if we optimize loading for subjects, we might not be optimizing for subject tags? (just some thoughts). It works fine for non-admin users, probably because they have fewer subjects. Let me know if there is anything I can do to help you fix this (eg, give you access to admin account).

image image image

olehkorkh-planeks commented 3 months ago

Hi @antoinefalisse Yes, I need to research it. Please, provide me your access credentials. I need an access to the account (including admin). I'm also thinking that maybe I'll need to download the dump of the database for local tests. If it is possible, I need to check it as well. Because, maybe, we'll need some more radical architecture changes for the frontend.

antoinefalisse commented 3 months ago
antoinefalisse commented 2 months ago

@olehkorkh-planeks two more small bugs:

see this video for details.