Skip to content

Conversation

@ndg63276
Copy link
Collaborator

@ndg63276 ndg63276 commented Dec 15, 2025

JIRA ticket: LIMS-2016

Summary:

When viewing a list of data collections, the list of id's is sent to the backend to see whether they have snapshots available on disk. Unfortunately, when there are robot actions in the list, the robot action ids are added to the list of ids to check.

The backend fails to verify the ids are relevant, so checks for snapshots assuming each id is for a data collection, but as robot action ids are smaller numbers than data collection ids, it often ends up looking at years old data collections from other proposals and beamlines. Sometimes these have snapshots in invalid locations, leading to a PHP error.

Changes:

  • In the frontend, change the logic so that only "data" and "grid" id's are sent
  • In the backend, verify any id's received belong to the proposal currently being looked at
  • Send in a project id if viewing a project to bypass the backend proposal check (as projects can view multiple proposals)

To test:

  • Visit https://ispyb-staging.diamond.ac.uk/dc/visit/cm40609-2 and notice the Internal Server Error that occurs on the backend requests to https://ispyb-staging.diamond.ac.uk/api/dc/chi
  • Also notice the payload sent to the backend includes ids of 18252576 (which is an i04-1 data collection) and 4543173 (which is a robot load in this case, but also the id to a 2019 i14 data collection)
  • Now visit /dc/visit/cm40609-2 with this patch, check the ids sent to the backend are only those beginning 1825xxxx, so no internal server error occurs
  • In Firefox you can Edit and Resend the request, do that adding an id of 4543173. Check there is no server error, and the response just ignores that id as it would belong to a different proposal
  • Go to a project with data collections from multiple proposals, eg /projects/pid/182. Check the (recent) snapshots appear.

@gfrn
Copy link
Collaborator

gfrn commented Dec 18, 2025

Had to add myself to the project to be able to view it, but LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants