Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When one works offline it usually makes sense to do both pull and push but on the other hand when one tries to push asap it might not always be desired to do full sync. One might for example want to push asap on web but not on native.
Even though WatermelonDB was initially designed with having single endpoint this isn't always the case either because of trying to use existing systems, having no control over systems or because there is need to have multiple endpoints. Previously pushing asap would do full sync and this combined with having multiple endpoints can trigger 10s of connections even when it would be mostly enough to do just one push connection. Because of so many connections even if data is minimal this can cause long execution times.
This PR essentially separates push part from synchronize and exposes it to lib-users.
This PR is related to multiple other PRs (#1738, #1552, #1548) which must be merged before. Since I don't know if any of these will be merged I am just pushing this here as is. All of these changes together will be available in our fork.