-
Notifications
You must be signed in to change notification settings - Fork 22
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
No deleted model tracking in deserialization #203
No deleted model tracking in deserialization #203
Conversation
An example of where creation of DeletedModel during deserialization could come into play:
Here's the code that handles that. ^^ So I'd recommend not doing a blanket muting of that deletion -- and instead figure out why it's getting triggered on the LoD (e.g. maybe even the deserialization of the synced deleted model triggers generation of a DeletedModel? For deletions that weren't initiated locally but rather synced in, it should skip that, as it's already marked as deleted in the Store -- but for things deleted as a result of them foreignkeying onto a deleted record, like in my scenario above, we do still want it to generate a DeletedModel so it gets written back to the Store). |
I think this would be the more focal place to wrap with the signal-skipper instead -- as it's handling the case where the deletion was synced in from elsewhere. |
cbe8398
to
8d4a4af
Compare
I have made the change more focal, and also added this section to the Kolibri ecosystem tests:
This seems to confirm that making this change doesn't affect the desired behaviour of deletion taking precedence over updates. I am going to attempt to add similar tests to this PR as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to mute the delete signal in the deserialization stage. While unlikely to run into the same issue that this fixes, I think it also makes sense to mute the signal for the hard deletion since the core problem is that deserializing shouldn't generate a DeletedModels
record.
Could you also increment the morango version and add a changelog entry so we can publish after merge?
I did wonder about that - can do.
Sure. |
Updated - I also added a couple of extra conditions/assertions to the Kolibri ecosystem tests to ensure this doesn't mess with transitive propagation of deletions, and it did not seem to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think your change to not differentiate between hard and soft deletes makes sense. In deserialization, the appropriate tracking records should already be created and the purpose of the hard delete functionality should be satisfied by that point.
One broken test it seems, but hopefully that just isn't matching the appropriate expectation for hard deletes
Summary
TODO
Reviewer guidance
This seems to not break any existing tests, either here or in the Kolibri integration tests (including an addition I made to test the issue this is intended to address).
What I don't know is if the DeletedModel creation during deserialization is desirable - one possible additional test would be to add an integration test on Kolibri for deletion on A, update on B, and ensure that deletion persists on C when both are synced to it.
Issues addressed
This is intended to resolve learningequality/kolibri#11208