Skip to content
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] Pushing 'w' to go to the next node to review throws an excessive error when the node has been deleted #2270

Open
acardona opened this issue Oct 2, 2024 · 1 comment

Comments

@acardona
Copy link
Contributor

acardona commented Oct 2, 2024

Part of the problem is that deleting and adding nodes isn't notified to the Review widget, but solving that would take quite some effort.

Instead, just show an non-invasive notification that the node doesn't exist and move on. The error is massive and sends the message that something is broken, when it isn't:

Unsuccessful request: {"error": "No Treenode matches the given query.", "detail": "Traceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/applications/catmaid/control/node.py\", line 2817, in update_location_reviewer\n r = Review.objects.get(treenode_id=node_id, reviewer=request.user)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/db/models/manager.py\", line 85, in manager_method\n return getattr(self.get_queryset(), name)(*args, **kwargs)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/db/models/query.py\", line 435, in get\n raise self.model.DoesNotExist(\ncatmaid.models.Review.DoesNotExist: Review matching query does not exist.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/shortcuts.py\", line 76, in get_object_or_404\n return queryset.get(*args, **kwargs)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/db/models/query.py\", line 435, in get\n raise self.model.DoesNotExist(\ncatmaid.models.Treenode.DoesNotExist: Treenode matching query does not exist.\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/core/handlers/base.py\", line 181, in _get_response\n response = wrapped_callback(request, *callback_args, **callback_kwargs)\n File \"/usr/lib/python3.8/contextlib.py\", line 75, in inner\n return func(*args, **kwds)\n File \"/opt/catmaid/fibsem/django/applications/catmaid/history.py\", line 69, in wrapped_f\n result = f(*args, **kwargs)\n File \"/opt/catmaid/fibsem/django/applications/catmaid/control/authentication.py\", line 235, in inner_decorator\n return f(request, *args, **kwargs)\n File \"/opt/catmaid/fibsem/django/applications/catmaid/control/node.py\", line 2819, in update_location_reviewer\n node = get_object_or_404(Treenode, pk=node_id)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.8/site-packages/django/shortcuts.py\", line 78, in get_object_or_404\n raise Http404('No %s matches the given query.' % queryset.model._meta.object_name)\ndjango.http.response.Http404: No Treenode matches the given query.\n", "type": "Http404", "meta": null}```
tomka added a commit that referenced this issue Dec 18, 2024
When a node is deleted in a skeleton under review, the Review Widget
will now refresh the segment respresentation and move on to the next
possible node in the segment.

Also, a warning is now shown if a node can't be found on the server when
marking it reviewed, assuming it might be deleted. This, however, should
usually not be visible, because the segments should have up-to-date
information.

Fixes #2270
@tomka
Copy link
Contributor

tomka commented Dec 18, 2024

This is now fixed in dev. I made the Review Widget handle missing nodes more gracefully with a warning. Updating the segment representation and moving to the next possible node after a treenode was deleted seemed however also not very hard to do, so I implemented this as well: if a node of a skeleton under review is deleted, the Review Widget will now update its segment representation and make the next possible node after the deleted one the currently reviewed node.

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

No branches or pull requests

2 participants