Target branch: release-0.8.x
Observed behavior
Observed on Kolibri, written up with some simplifications.
Data model
A syncable Django model User has a unique constraint on two fields:
dataset_id
picture_password
Ignore security concerns. This has a very purposeful use case in Kolibri.
Scenario
- Two devices, A and B, both create individual
User records on their devices for the same dataset_id and picture_password.
- Devices A and B use Morango to sync with each other
- Since two
User records have the constraint to prevent duplicate picture_password for the same dataset_id, the records should fail to deserialize during the sync
- After the sync completes, Device A does not have the conflicting
User record for the user created on Device B, and vice versa (expected due to the unique constraint)
- Reviewing the sync logs, no warnings were shown about failing to deserialize any models
- Checking the Morango
Store, the user records do exist, but do not have any deserialization_error and also do not have dirty_bit=True (😱 )
Errors and logs
None observed!
Expected behavior
- Morango logs warnings about the
Store records that failed to deserialize to their app models (User)
- Morango adds a
deserialization_error to the store records annotating the error
- This scenario should not fail the entire sync
Small enhancement
Additionally, it would be convenient if we updated Morango to have another field, perhaps deserialization_exception, which provides the fully-qualified exception module path of the error that occurred during deserialization. The deserialization_error would continue to be a string message of the error.
User-facing consequences
The silent failure to deserialize makes it appear that data was lost, which would be a cause for concern among end-users.
Steps to reproduce
Suggestion is to write a regression test and prove this scenario, then address fixing it.
Context
Morango 0.8
Kolibri 0.19
Target branch: release-0.8.x
Observed behavior
Observed on Kolibri, written up with some simplifications.
Data model
A syncable Django model
Userhas a unique constraint on two fields:dataset_idpicture_passwordIgnore security concerns. This has a very purposeful use case in Kolibri.
Scenario
Userrecords on their devices for the samedataset_idandpicture_password.Userrecords have the constraint to prevent duplicatepicture_passwordfor the samedataset_id, the records should fail to deserialize during the syncUserrecord for the user created on Device B, and vice versa (expected due to the unique constraint)Store, the user records do exist, but do not have anydeserialization_errorand also do not havedirty_bit=True(😱 )Errors and logs
None observed!
Expected behavior
Storerecords that failed to deserialize to their app models (User)deserialization_errorto the store records annotating the errorSmall enhancement
Additionally, it would be convenient if we updated Morango to have another field, perhaps
deserialization_exception, which provides the fully-qualified exception module path of the error that occurred during deserialization. Thedeserialization_errorwould continue to be a string message of the error.User-facing consequences
The silent failure to deserialize makes it appear that data was lost, which would be a cause for concern among end-users.
Steps to reproduce
Suggestion is to write a regression test and prove this scenario, then address fixing it.
Context
Morango 0.8
Kolibri 0.19