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

First pass at MVP single-user syncing backend #7985

Merged
merged 4 commits into from Apr 26, 2021

Conversation

jamalex
Copy link
Member

@jamalex jamalex commented Apr 9, 2021

Summary

First pass at #7858, adding the --user-id parameter to the sync management command, to initiate single-user syncing.

Some fun facts:

  • No changes were needed to Morango, or to the "server side" of Kolibri. Just some modifications to the sync command itself and to its supporting utils functions. This means that the current code is actually backwards-compatible with older versions of Kolibri running as the "server".
  • Given the top-level partition they're under, Lessons, Exams, and their Assignments are not in fact currently included in a single-user sync. So we'll be building a side-channel syncing method for that instead, which was our fallback. That does mean that when syncing against older Kolibri versions, to a single-user device, these models won't be included. For that reason, we may not actually want to allow it to be back-compatible, to avoid confusion.

References

Reviewer guidance

I tested this by creating two Kolibri data directories, one to act as the server, the other as the client:

export KOLIBRI_HOME=~/.singleusersyncserver
yarn run python-devserver
# and then used the UI to provision it, and add a user
export KOLIBRI_HOME=~/.singleusersyncclient
# the following values are based on the facility ID and user ID from the other server
kolibri manage sync --user-id=71f1b6a9c53e79f379bd96a6464a3025 --facility=d1cf3dfad3c01583100467336d7b3693 --baseurl=http://127.0.0.1:8000
# when it asks for credentials, you can put in either the superuser or the learner account that were created

@rtibbles is working on updating/fixing the automated syncing tests to cover this.


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 (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@jamalex jamalex added this to the 0.15.0 milestone Apr 9, 2021
@indirectlylit
Copy link
Contributor

Given the top-level partition they're under, Lessons, Exams, and their Assignments are not in fact currently included in a single-user sync.

Sounds like this is new since the last discussion? I'd really hoped to avoid side channels if possible

@indirectlylit
Copy link
Contributor

@rtibbles
Copy link
Member

MacOS Build agent appears to be waiting forever.

@rtibbles rtibbles merged commit f145452 into learningequality:develop Apr 26, 2021
@rtibbles rtibbles deleted the single_user_sync branch April 26, 2021 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create proof of concept single user syncing to test for edge cases and possible issues
3 participants