-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Concurrently editing and deleting idea results in Ecto.NoResultsError #528
Comments
I think that's very fair and a fun scenario. I think the question here is only how it will be presented to the user. I'd avoid writing a lot of custom code and custom checks for this as there will potentially tons of cases for issues like this (somebody comments on an idea that someone else deletes, someone moves an idea someone else is deleting... etc.). So, I think that the best way is to display a fitting error message to the user when this exceptional case occurs :) |
Well, I might have used not the correct words. I am more referring to an easier case: one user opens the edit modal of an idea, types something and at the same time the other user deletes the idea. So this is not a very rare case, can definitely happen as you have like 10+ seconds to reach the scenario. And it results in the error shown above. We do not need fancy error handling but at least closing the modal and showing a flash error would be good. You are right that there are more scenarios where this can happen! |
yeah it's definitely common but what I meant to say/do was just that: Display an error like "oops something went wrong with that idea" and at best close the overlay. Just wanted to say, that if you try to accommodate for each of those on an individual basis it might get really hard. I mean it may be needed esp. in a class room context like "oh someone deleted this sorry". Thinking about it, potentially you'd want to give the user to even restore the idea someone else had deleted - but that gets even harder. One could even "lock" ideas from deletion for a certain time after interaction but that also gets difficult.... fun problems. |
Further Notes
When opening the edit modal and another user deletes the same idea, an error (Ecto.NoResultsError) is thrown. Error handling is missing in this case.
lib/mindwendel_web/live/brainstorming_live/show.ex:151
The text was updated successfully, but these errors were encountered: