orppst / pst-gui

web based front end for the tool
Mozilla Public License 2.0
0 stars 0 forks source link

proposal filtering seems to hang now. only refreshing every 5 minutes. #91

Closed alan-stokes closed 4 months ago

alan-stokes commented 5 months ago

It seems something has gone funky with the proposal filter, in that you type text to filter by name, and nothing happens for approx 5 minutes. see attached photo where for approx 5 minutes this was the output, until it randomly updated and showed the sole bacon proposal. Screenshot from 2024-01-22 13-38-24

am yet able to understand whats going on here.

AllanEngland commented 5 months ago

I can replicate this, will go check if I've broken something in the API...

AllanEngland commented 5 months ago

When the search criteria is updated, the web app times out on it's first attempt to get the list of proposals (from pst/api/proposals) however, as soon as it tries again, it succeeds immediately. I can't replicate this with the api's dev swagger ui, but also haven't yet been able to identify if the problem is in the gui. I tried rolling back the most recent changes to pst/api/proposals, but this hasn't fixed it.

So I'm still investigating.

AllanEngland commented 5 months ago

The problem appears to be the proposal search results don't update when the filter criteria is changed, therefore the only way to see it update is either to refresh the page, or wait for the auth token to expire which consequently refreshes the page and results - giving an appearance of a long wait before the filter takes effect.

I believe this is a problem with how the state variables (proposalTitle and investigatorName) are declared and redeclared in App2.tsx. The fault appears to have started at or around commit cc5f64b.

I have a fix for this, although it's introduced some new problems! Once I resolve those, this should be done.

AllanEngland commented 4 months ago

Have finally fixed this. Had to bring some code back into the main function that had been separated out. Might benefit from a future clean up, but at least it's working correctly now.