kolibri
kolibri copied to clipboard
Learner devices status update
Summary
- Turns the learner device status user field to a ForeignKey rather than OneToOne field to prevent errors when trying to create learner device statuses for the same learner for syncs from multiple devices
- Adds sync hook to selectively delete LearnerDeviceStatus to prevent trying to sync more than one LearnerDeviceStatus for a single user to another device.
References
Fixes #12043
Reviewer guidance
The logic is relatively straight forward, I think - I am just not sure how to do any sort of test of this change, especially the version sync hook.
Testing checklist
- [ ] Contributor has fully tested the PR manually
- [ ] If there are any front-end changes, before/after screenshots are included
- [ ] Critical user journeys are covered by Gherkin stories
- [ ] Critical and brittle code paths are covered by unit tests
PR process
- [ ] PR has the correct target branch and milestone
- [ ] PR has 'needs review' or 'work-in-progress' label
- [ ] If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
- [ ] If this is an important user-facing change, PR or related issue has a 'changelog' label
- [ ] If this includes an internal dependency change, a link to the diff is provided
Reviewer checklist
- Automated test coverage is satisfactory
- PR is fully functional
- PR has been tested for accessibility regressions
- External dependency files were updated if necessary (
yarnandpip) - Documentation is updated
- Contributor is in AUTHORS.md
| :rocket: This description was created by Ellipsis for commit 2d91ec9f5a35fc65a39d5abf078afaa1f5082b8d |
|---|
Summary:
This PR updates the LearnerDeviceStatus model to support multiple device statuses per user and adds a sync operation to manage data consistency across device syncs.
Key points:
- Changed
LearnerDeviceStatus.userfromOneToOneFieldtoForeignKey. - Added
LearnerDeviceStatusOperationto handle deletion of problematicLearnerDeviceStatusrecords during sync. - Introduced
LearnerDeviceStatusHookto trigger the new operation during sync. - Added migration
0022_learner_device_status_multiple_devices.pyfor database schema update.
Generated with :heart: by ellipsis.dev
Build Artifacts
| Asset type | Download link |
|---|---|
| PEX file | kolibri-0.16.2b1.dev0_git.36.g5a1dab2d.pex |
| Windows Installer (EXE) | kolibri-0.16.2b1.dev0+git.36.g5a1dab2d-windows-setup-unsigned.exe |
| Debian Package | kolibri_0.16.2b1.dev0+git.36.g5a1dab2d-0ubuntu1_all.deb |
| Mac Installer (DMG) | kolibri-0.16.2b1.dev0+git.36.g5a1dab2d-0.4.2.dmg |
| Android Package (APK) | kolibri-0.16.2b1.dev0+git.36.g5a1dab2d-0.1.2-debug.apk |
| TAR file | kolibri-0.16.2b1.dev0+git.36.g5a1dab2d.tar.gz |
| WHL file | kolibri-0.16.2b1.dev0+git.36.g5a1dab2d-py2.py3-none-any.whl |
Hey @ellipsis, give me a code review
OK! Reviewing this PR...
Responding to this comment by @rtibbles. For more information about Ellipsis, check the documentation.
Hi @rtibbles no issues observed while checking the above described QA scenario - the devices were syncing correctly. I do see some errors in the server logs so posting these here for you in case you find anything that needs to be fixed:
Hi @rtibbles no issues observed while checking the above described QA scenario - the devices were syncing correctly. I do see some errors in the server logs so posting these here for you in case you find anything that needs to be fixed:
Looks like some DB locking errors