kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Unable to delete a Quiz in case where the resource(s) inside don't exist // case of disappearing and reappearing content in a Quiz

Open lauradanforth opened this issue 1 year ago • 4 comments

This was on kolibri-demo on 0.16.2:

Observed behavior

While logged in as an admin, in the Plan tab I noticed that one of my quizzes had content in it that no longer existed in the platform, so I tried to delete the Quiz. I got this pop up: image But when trying to click the 'Delete' button, nothing happened.

When I refreshed the page, the Quiz was still there but I also noticed that the content had been restored: image

Context

Tell us about your environment, including:

  • Kolibri version - 0.16.2
  • Operating system - Mac OSX
  • Browser - Chrome

lauradanforth avatar Jul 01 '24 23:07 lauradanforth

Hmm I tested this locally on Kolibri 0.16.2 and deleting a quiz with or without resources is working correctly so this must be some strange edge case:

https://github.com/learningequality/kolibri/assets/79847249/e59921c3-f4d8-4798-bc9a-c0423d0ed0da

https://github.com/learningequality/kolibri/assets/79847249/ccfc56f6-6e24-4a08-bbf5-099fe33fed4f

pcenov avatar Jul 03 '24 14:07 pcenov

Alrighty just adding that I've also not been able to replicate the error noted here on develop either.

I think that this Sentry error is related which suggests that this is a bug on the front-end.

I think that this is very much an edge case and that we can lower the priority on this one.

IMO next steps here are to just look at the quiz deletion machinery again to work out if there is a way for the quiz's ID value to be nulled that we can stop.

nucleogenesis avatar Jul 03 '24 16:07 nucleogenesis

I managed to replicate this, and yes, it is actually a very edge case. It happened because the server responded a 502 error on GET /api/exams/exam/size/, and for that reason, the frontend detects as it lost the connection with the server and doesnt load the data of the exam and resources, so thats why it says that resource is missing. And when you click on delete, we dont have the exam id, and thats why the delete button doesnt work.

Then, after reloading the page the server is already working ok and doesnt return the 502 error and thats why we can see the resources again.

So this error si more of why the server was unavailable and the gateway returned a 502, and why the frontend didnt show the "trying to reconnect" backdrop.

AlexVelezLl avatar Jul 10 '24 19:07 AlexVelezLl

I think the answer here is just better error handling on the size calculation and optimization of the size calculation endpoints.

rtibbles avatar Jul 26 '24 16:07 rtibbles