-
Notifications
You must be signed in to change notification settings - Fork 3
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
Logging deletion operations #2
Comments
Looks like a good first contribution ;) I'm investigating taking this issue and just trying to understand the work. Could you have a look at cdharris@b9f8f5b and let me know if I'm on the right track and whether you think there's anything else that would need to be done that's missing? Thanks! |
Yeah, you're exactly on the right track! Although this test seems to not delete how it says it deletes. For now, I think those are enough tests. We'll have to think about weird combinations to confuse the system at some later stage ;) |
Thanks for the reassurance. Hopefully I've covered most of it in the PR here #3 |
Yup, all good! |
First, a bit of background info on how the Sync works:
1a) The custom PK middleware generates a random ID for each new object instead of an auto-incremented ID to prevent ID conflicts between devices
1b) The Sync Log middleware intercepts all modifications to the database and also writes them to the Client Sync Log
The integration tests from which you can drill down can be found here:
https://github.com/WorldBrain/storex-sync/blob/4c5cce706d0223e9a6be12ad49c82af0c5b37b9e/ts/index.test.ts
This Sync Log middleware that writes all executed operations to a log can be found here:
https://github.com/WorldBrain/storex-sync/blob/4c5cce706d0223e9a6be12ad49c82af0c5b37b9e/ts/logging-middleware/index.test.ts
https://github.com/WorldBrain/storex-sync/blob/4c5cce706d0223e9a6be12ad49c82af0c5b37b9e/ts/logging-middleware/index.ts
What's missing from this middleware, is writing deletions to the log. For this you'll need to write some failing tests in the same way as above, and then write the implementations for that functionality.
Using this repository, you can work on all packages at once easily (which is necessary because there are lots of small Storex packages working together):
https://github.com/WorldBrain/storex-workspace
The text was updated successfully, but these errors were encountered: