Skip to content

ValidationError: Completion criteria doesn't conform to schema #3879

Closed

Description

@sentry

@bjester has observed completion criteria for some nodes getting saved in an invalid state, likely reproducible through quick repeated changes to the criteria in the frontend.

Sentry Issue: STUDIO-FGH

ValidationError: ["Completion criteria doesn't conform to schema", "object doesn't satisfy 'anyOf' conditions"]
  File "contentcuration/viewsets/contentnode.py", line 406, in _check_completion_criteria
    completion_criteria_validator.validate(completion_criteria, kind)
  File "contentcuration/constants/completion_criteria.py", line 97, in validate
    raise e

ValidationError: [ErrorDetail(string='["Completion criteria doesn\'t conform to schema", "object doesn\'t satisfy \'anyOf\' conditions"]', code=None)]
(3 additional frame(s) were not displayed)
...
  File "rest_framework/serializers.py", line 703, in save
    self.instance = self.update(self.instance, validated_data)
  File "contentcuration/viewsets/contentnode.py", line 246, in update
    all_objects = super(ContentNodeListSerializer, self).update(
  File "contentcuration/viewsets/base.py", line 309, in update
    instance = self.child.update(obj, obj_validated_data)
  File "contentcuration/viewsets/contentnode.py", line 437, in update
    self._check_completion_criteria(validated_data.get("kind", instance.kind_id), validated_data.get("complete", instance.complete), validated_data)
  File "contentcuration/viewsets/contentnode.py", line 410, in _check_completion_criteria
    raise ValidationError(e)

Activity

  1. bjester commented on Mar 28, 2023

    @bjester
    Member

    Users encounter that these nodes become invalid and will not be published

  2. akolson commented on Jul 29, 2024

    @akolson
    Member

    @bjester the referenced link

    Sentry Issue: STUDIO-FGH

    cant seem to be found. Maybe it's been deleted? Does it make a difference anyway considering we already have a copy of the traceback on the issue?

  3. bjester commented on Jul 29, 2024

    @bjester
    Member

    @akolson Yeah even though the error in Sentry doesn't exist, I believe my description of the error is correct. We merge changes in the frontend, prior to syncing, and I believe that merge behavior can incorrectly handle object fields like completion criteria, which have a strict well defined schema.

  4. bjester commented on Jul 29, 2024

    @bjester
    Member

    Update: talking and digging in with @ozer550, we do merge changes but we merge them when we fetch. so there's still a theoretical chance we can merge incorrectly. I suggested a regression test on combineUpdateAndUpdate might illuminate the possibility it could produce invalid completion criteria

  5. radinamatic commented on Aug 27, 2024

    @radinamatic
    Member

    Tried to change the completion criteria to more than 10 HTML5 resources in a row as fast as a could 🏃🏽‍♀️ ⏩
    Not sure if any sentry errors occurred, but noting concerning user-facing was happening in the front-end, good job! 👍🏽

  6. akolson commented on Aug 27, 2024

    @akolson
    Member

    It doesn't look so @radinamatic! All seems good in sentry 🎉

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions