You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user attempts to update the completion criteria of a ContentNode, the system fails to revert to the last valid state if a backend validation error occurs. This results in an unexpected state of completion criteria, which does not reflect the last correct configuration.
Expected behavior
Frontend should have the last correct state of completion criteria (we would want to revert the optimistic changes) in such a way that the user knows that other changes have overridden theirs.
User-facing consequences
Inconsistent/Incorrect state of completion criteria for a Contentnode while collaborating.
Errors and logs
[2024-08-20 08:05:32,634: ERROR/ForkPoolWorker-1] [ErrorDetail(string='["Completion criteria doesn\'t conform to schema", "object doesn\'t satisfy \'anyOf\' conditions"]', code=None)]
Traceback (most recent call last):
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/contentnode.py", line 414, in _check_completion_criteria
completion_criteria_validator.validate(completion_criteria, kind)
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/constants/completion_criteria.py", line 97, in validate
raise e
django.core.exceptions.ValidationError: ["Completion criteria doesn't conform to schema", "object doesn't satisfy 'anyOf' conditions"]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/base.py", line 864, in update_from_changes
self.perform_bulk_update(serializer)
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/base.py", line 851, in perform_bulk_update
serializer.save()
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/base.py", line 364, in save
instance = super(BulkListSerializer, self).save(**kwargs)
File "/home/ozer/.pyenv/versions/3.10.13/envs/studio-py3.10/lib/python3.10/site-packages/rest_framework/serializers.py", line 753, in save
self.instance = self.update(self.instance, validated_data)
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/contentnode.py", line 250, in update
all_objects = super(ContentNodeListSerializer, self).update(
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/base.py", line 311, in update
instance = self.child.update(obj, obj_validated_data)
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/contentnode.py", line 445, in update
self._check_completion_criteria(validated_data.get("kind", instance.kind_id), validated_data.get("complete", instance.complete), validated_data)
File "/home/ozer/workspace/LE/studio/contentcuration/contentcuration/viewsets/contentnode.py", line 418, in _check_completion_criteria
raise ValidationError(e)
rest_framework.exceptions.ValidationError: [ErrorDetail(string='["Completion criteria doesn\'t conform to schema", "object doesn\'t satisfy \'anyOf\' conditions"]', code=None)]
ozer550
changed the title
Inconsistent state of completion Criteria in contentNode Due to backend validation errors
Inconsistent state of completion criteria in contentnode due to backend validation errors
Aug 22, 2024
Hi @shivam-daksh, thanks for volunteering. I just assigned you another issue. Please ask for an assignment of a reasonable amount of issues - typically we would assign only one or two issues max at once. We're happy to assign you more 'help wanted' later on.
Observed behavior
When a user attempts to update the completion criteria of a ContentNode, the system fails to revert to the last valid state if a backend validation error occurs. This results in an unexpected state of completion criteria, which does not reflect the last correct configuration.
Expected behavior
Frontend should have the last correct state of completion criteria (we would want to revert the optimistic changes) in such a way that the user knows that other changes have overridden theirs.
User-facing consequences
Inconsistent/Incorrect state of completion criteria for a Contentnode while collaborating.
Errors and logs
Additional information
follow up #3879
Steps to reproduce the issue
The text was updated successfully, but these errors were encountered: