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

Update Lesson and Exam model infer_dataset method to use the collection rather than assigned_by foreign key #7859

Closed
rtibbles opened this issue Mar 15, 2021 · 1 comment · Fixed by #7887
Labels
bug Behavior is wrong or broken P0 - critical Priority: Release blocker or regression
Milestone

Comments

@rtibbles
Copy link
Member

rtibbles commented Mar 15, 2021

When Lesson and Exam models were first created, their infer_dataset method referred to the user that it was assigned by using the assigned_by ForeignKey.

In a scenario where only a limited subset of a facility's data is synchronized to a device, such as in a single learner syncing scenario, this would cause Lessons and Quizzes to remain forever serialized in the Morango store, as the data for the assigning user would be absent, as outside the partition of data that would be synced for a single user.

In order to ensure that Lesson and Exam models can be properly deserialized, their infer_dataset method should instead rely on the collection ForeignKey, as the full Collection hierarchy of the Facility will be shared during a single user sync.

@rtibbles rtibbles changed the title Update Lesson and Quiz infer_dataset method to use the collection rather than assigned_by foreign key Update Lesson and Exam model infer_dataset method to use the collection rather than assigned_by foreign key Mar 15, 2021
@rtibbles rtibbles added the P0 - critical Priority: Release blocker or regression label Mar 16, 2021
@udithprabhu udithprabhu mentioned this issue Mar 17, 2021
9 tasks
@udithprabhu
Copy link
Contributor

I have raised PR for this in the Draft mode as I wanted to know if you would like me to add test cases for this. I was thinking of adding test case to check whether the output of cached_related_dataset_lookup(created_by) is equal to cached_related_dataset_lookup(collection).

Please let me know if that is fine

@jonboiser jonboiser linked a pull request Mar 22, 2021 that will close this issue
9 tasks
@jonboiser jonboiser added this to the 0.15.0 milestone Mar 22, 2021
@jonboiser jonboiser added the bug Behavior is wrong or broken label Mar 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Behavior is wrong or broken P0 - critical Priority: Release blocker or regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants