Skip to content
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

Push only support #1739

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Push only support #1739

wants to merge 7 commits into from

Conversation

primus11
Copy link

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.

When design is set that each resource must be confirmed as synced it is safer to look at it from whitelist perspective than blacklist to prevent possible miss-sync.
# Conflicts:
#	src/sync/impl/helpers.js
# Conflicts:
#	src/sync/impl/helpers.d.ts
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant