-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Syncer: make sure collections which are deleted are not synced #1065
Syncer: make sure collections which are deleted are not synced #1065
Conversation
It works just fine and I thought of doing that too, but I think it's not explicit enough, since createCollections now has that sideeffect. Of course we can document it in the method KDoc, but as a general principle I was taught sideeffects are unclear and therefore dangerous, so I thought we would not want them in the sync code :) https://en.wikipedia.org/wiki/Side_effect_(computer_science) |
* - Deletes local collections if corresponding database collections are missing. | ||
* | ||
* - Deletes local collections if corresponding database collections are missing. If | ||
* a local collection is removed because it's not in [dbCollections], **it becomes also removed from [localCollections]!** |
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.
This is documenting the sideeffect, but it would be better not to have the sideeffect in the first place IMO :)
Maybe replaces #1064
@sunkup Does that not work for you?