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

Add support for uploading. and downloading changes easily #2124

Merged
merged 16 commits into from Nov 21, 2018

Conversation

cmelchior
Copy link
Contributor

@cmelchior cmelchior commented Nov 20, 2018

Closes #2122

This PR adds two new API's:

Realm.Sync.Session.uploadAllLocalChanges(timeout): Promise<void>
Realm.Sync.Session.downloadAllServerChanges(timeout): Promise<void>

These match the methods found in Realm Java.

TODO:

  • Fix tests
  • Changelog
  • Cleanup

@cmelchior cmelchior self-assigned this Nov 20, 2018
lib/extensions.js Outdated Show resolved Hide resolved
lib/extensions.js Outdated Show resolved Hide resolved
lib/index.d.ts Outdated Show resolved Hide resolved
lib/extensions.js Outdated Show resolved Hide resolved
lib/index.d.ts Outdated Show resolved Hide resolved
lib/index.d.ts Outdated Show resolved Hide resolved
@cmelchior
Copy link
Contributor Author

Ready for review

src/js_sync.hpp Outdated
Function<T>::callback(protected_ctx, protected_callback, typename T::Object(), 1, callback_arguments);
});

completion_func = std::move(completion_handler);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to move twice?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern was copied from add_progress_notification, but not sure it is strictly needed

Copy link
Member

@nirinchev nirinchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, just have some minor code style comments

lib/extensions.js Outdated Show resolved Hide resolved
lib/extensions.js Outdated Show resolved Hide resolved
src/js_sync.hpp Show resolved Hide resolved
tests/js/session-tests.js Outdated Show resolved Hide resolved
@cmelchior cmelchior merged commit a680084 into master Nov 21, 2018
@cmelchior cmelchior deleted the cm/upload-download branch November 21, 2018 22:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants