BIDMCDigitalPsychiatry / LAMP-platform

The LAMP Platform (issues and documentation).
https://docs.lamp.digital/
Other
13 stars 10 forks source link

Broken API request on Data Portal #662

Closed lukeoftheshire closed 2 years ago

lukeoftheshire commented 2 years ago

As part of a large commit, several API requests in the data portal were erroneously changed in RenderTree.tsx, possibly due to a incorrectly applied find-replace.

In a later commit the commands were partially reverted but not fully - leading the requests to be malformed when submitted to the server.

In brief, both a period(.) and curly brace(}) were added to the query but only the period was removed https://user-images.githubusercontent.com/34659264/175655450-5e0f9dd5-444b-45e1-82f6-f952163ed273.png

This malformed query breaks the flow of the data portal as requests for the children of parent LAMP elements (e.g. studies under researchers, users under studies) are no longer queried correctly and instead show up as undefined. image

This change should be reverted as expediently as is possible to restore normal function. It should mainly affect three lines in RenderTree.tsx and should thus be hopefully a quick change.

I have further outlined this issue in a comment on the commit in question. https://github.com/BIDMCDigitalPsychiatry/LAMP-dashboard/commit/6cb11f81a275289cfb6d65f6e705921d3c1c1e63#r76928533

In case it helps, I currently believe that the broken lines are currently at (as of June 24, 2022) lines 192, 195, and 206 in https://github.com/BIDMCDigitalPsychiatry/LAMP-dashboard/blame/master/src/components/data_portal/RenderTree.tsx .

lukeoftheshire commented 2 years ago

In addition, this issue is making it difficult for researchers and collaborators who want to easily pull activity specs - for example, as requested in https://github.com/BIDMCDigitalPsychiatry/LAMP-platform/issues/625.

Prior to this commit pulling the activity json for a study from the data portal would have been relatively trivial as it was possible to navigate the tree in the sidebar and pull activity data for individual studies with a few clicks. However, since this commit broke the queries that were responsible for pulling information about studies from researchers this is no longer possible, obscuring our ability to help researchers diagnose dashboard bugs

sarithapillai8 commented 2 years ago

@lukeoftheshire This happened at the time of fixing vulnerabilities with some latest versions. We can check and update ASAP.

sarithapillai8 commented 2 years ago

@lukeoftheshire The code is restored in dashboard-staging . Could you please check ?

lukeoftheshire commented 2 years ago

Hi @sarithapillai8 - looks good! Functionality seems to be back to normal on dashboard-staging and all three lines we found look good.

I'm going to close this since the issue has been resolved.

lugray1 commented 2 years ago

This seems to be fixed in staging! 🎉