Merge pull request #1000 from realm/rt/use-sync-1.8.3

Use sync 1.8.3
This commit is contained in:
Radu Tutueanu 2017-05-05 16:08:52 +02:00 committed by GitHub
commit 42bbdc9f07
8 changed files with 86 additions and 26 deletions

View File

@ -1,6 +1,8 @@
### Breaking changes
* Files written by Realm this version cannot be read by earlier versions of Realm.
Old files can still be opened and files open in read-only mode will not be modified.
* The `setVerifyServersSslCertificate` method has been deleted
* The SyncConfig now gets two more optional parameters, `validate_ssl` and `ssl_trust_certificate_path`.
### Enhancements
* None

2
Jenkinsfile vendored
View File

@ -123,7 +123,7 @@ def reportStatus(target, state, String message) {
],
reposSource: [$class: 'ManuallyEnteredRepositorySource', url: 'https://github.com/realm/realm-js']
])
} catch(Exception e) {
} catch(Exception err) {
echo "Error posting to GitHub: ${err}"
}
}

View File

@ -80,7 +80,9 @@
["OS=='mac'", {
"sources": [
"src/object-store/src/impl/apple/external_commit_helper.cpp",
"src/object-store/src/impl/apple/keychain_helper.cpp"
"src/object-store/src/impl/apple/keychain_helper.cpp",
"src/object-store/src/sync/impl/apple/network_reachability_observer.cpp",
"src/object-store/src/sync/impl/apple/system_configuration.cpp"
]
}],
["realm_enable_sync", {

View File

@ -1,5 +1,5 @@
PACKAGE_NAME=realm-js
VERSION=1.2.0
REALM_CORE_VERSION=2.6.0
REALM_SYNC_VERSION=1.5.2
REALM_SYNC_VERSION=1.8.3
REALM_OBJECT_SERVER_VERSION=1.3.0

View File

@ -31,6 +31,9 @@ class Sync {
* _Currently only the 'change' event is supported_
* @param {function(change_event)} change_callback - called when changes are made to any Realm which
* match the given regular expression
* @param {bool} validate_ssl=true - Validate the server's SSL chertificate.
* @param {string} ssl_trust_certificate_path=None - Path to a trust/anchor certificate used by the
* client to verify the server certificate.
*/
static addListener(server_url, admin_user, regex, name, change_callback) {}

View File

@ -41,6 +41,10 @@
02F59EE21C88F2BB007F774C /* realm_coordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59EDB1C88F2BA007F774C /* realm_coordinator.cpp */; };
02F59EE31C88F2BB007F774C /* transact_log_handler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 02F59EDD1C88F2BB007F774C /* transact_log_handler.cpp */; };
502B07E41E2CD201007A84ED /* object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 502B07E31E2CD1FA007A84ED /* object.cpp */; };
504CF85E1EBCAE3600A9A4B6 /* network_reachability_observer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 504CF8541EBCAE3600A9A4B6 /* network_reachability_observer.cpp */; };
504CF85F1EBCAE3600A9A4B6 /* system_configuration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 504CF8561EBCAE3600A9A4B6 /* system_configuration.cpp */; };
504CF8601EBCAE3600A9A4B6 /* sync_file.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 504CF85A1EBCAE3600A9A4B6 /* sync_file.cpp */; };
504CF8611EBCAE3600A9A4B6 /* sync_metadata.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 504CF85C1EBCAE3600A9A4B6 /* sync_metadata.cpp */; };
50C671001E1D2D31003CB63C /* thread_safe_reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5D02C7791E1C83650048C13E /* thread_safe_reference.cpp */; };
5D25F5A11D6284FD00EBBB30 /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = F63FF3301C16434400B3B8E0 /* libz.tbd */; };
8507156E1E2CFCD000E548DB /* object_notifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8507156B1E2CFC0100E548DB /* object_notifier.cpp */; };
@ -174,6 +178,16 @@
02F59EDE1C88F2BB007F774C /* transact_log_handler.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = transact_log_handler.hpp; sourceTree = "<group>"; };
502B07E31E2CD1FA007A84ED /* object.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = object.cpp; path = src/object.cpp; sourceTree = "<group>"; };
502B07E51E2CD20D007A84ED /* object.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = object.hpp; path = src/object.hpp; sourceTree = "<group>"; };
504CF8541EBCAE3600A9A4B6 /* network_reachability_observer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = network_reachability_observer.cpp; sourceTree = "<group>"; };
504CF8551EBCAE3600A9A4B6 /* network_reachability_observer.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = network_reachability_observer.hpp; sourceTree = "<group>"; };
504CF8561EBCAE3600A9A4B6 /* system_configuration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = system_configuration.cpp; sourceTree = "<group>"; };
504CF8571EBCAE3600A9A4B6 /* system_configuration.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = system_configuration.hpp; sourceTree = "<group>"; };
504CF8581EBCAE3600A9A4B6 /* network_reachability.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = network_reachability.hpp; sourceTree = "<group>"; };
504CF8591EBCAE3600A9A4B6 /* sync_client.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sync_client.hpp; sourceTree = "<group>"; };
504CF85A1EBCAE3600A9A4B6 /* sync_file.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sync_file.cpp; sourceTree = "<group>"; };
504CF85B1EBCAE3600A9A4B6 /* sync_file.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sync_file.hpp; sourceTree = "<group>"; };
504CF85C1EBCAE3600A9A4B6 /* sync_metadata.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sync_metadata.cpp; sourceTree = "<group>"; };
504CF85D1EBCAE3600A9A4B6 /* sync_metadata.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = sync_metadata.hpp; sourceTree = "<group>"; };
5D02C7781E1C83650048C13E /* execution_context_id.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = execution_context_id.hpp; path = src/execution_context_id.hpp; sourceTree = "<group>"; };
5D02C7791E1C83650048C13E /* thread_safe_reference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = thread_safe_reference.cpp; path = src/thread_safe_reference.cpp; sourceTree = "<group>"; };
5D02C77A1E1C83650048C13E /* thread_safe_reference.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = thread_safe_reference.hpp; path = src/thread_safe_reference.hpp; sourceTree = "<group>"; };
@ -426,6 +440,7 @@
02E315CC1DB80DE000555337 /* sync */ = {
isa = PBXGroup;
children = (
504CF8521EBCAE3600A9A4B6 /* impl */,
02E315CD1DB80DF200555337 /* sync_client.hpp */,
02E315CE1DB80DF200555337 /* sync_file.cpp */,
02E315CF1DB80DF200555337 /* sync_file.hpp */,
@ -442,6 +457,32 @@
name = sync;
sourceTree = "<group>";
};
504CF8521EBCAE3600A9A4B6 /* impl */ = {
isa = PBXGroup;
children = (
504CF8531EBCAE3600A9A4B6 /* apple */,
504CF8581EBCAE3600A9A4B6 /* network_reachability.hpp */,
504CF8591EBCAE3600A9A4B6 /* sync_client.hpp */,
504CF85A1EBCAE3600A9A4B6 /* sync_file.cpp */,
504CF85B1EBCAE3600A9A4B6 /* sync_file.hpp */,
504CF85C1EBCAE3600A9A4B6 /* sync_metadata.cpp */,
504CF85D1EBCAE3600A9A4B6 /* sync_metadata.hpp */,
);
name = impl;
path = src/sync/impl;
sourceTree = "<group>";
};
504CF8531EBCAE3600A9A4B6 /* apple */ = {
isa = PBXGroup;
children = (
504CF8541EBCAE3600A9A4B6 /* network_reachability_observer.cpp */,
504CF8551EBCAE3600A9A4B6 /* network_reachability_observer.hpp */,
504CF8561EBCAE3600A9A4B6 /* system_configuration.cpp */,
504CF8571EBCAE3600A9A4B6 /* system_configuration.hpp */,
);
path = apple;
sourceTree = "<group>";
};
F62A35131C18E6E2004A917D /* iOS */ = {
isa = PBXGroup;
children = (
@ -837,10 +878,13 @@
02022A581DA476CD000F0C4F /* external_commit_helper.cpp in Sources */,
02022A5A1DA476CD000F0C4F /* weak_realm_notifier.cpp in Sources */,
02022A5B1DA476CD000F0C4F /* placeholder.cpp in Sources */,
504CF8611EBCAE3600A9A4B6 /* sync_metadata.cpp in Sources */,
502B07E41E2CD201007A84ED /* object.cpp in Sources */,
02414BA51CE6ABCF00A8669F /* collection_change_builder.cpp in Sources */,
02414BA61CE6ABCF00A8669F /* collection_notifier.cpp in Sources */,
504CF85F1EBCAE3600A9A4B6 /* system_configuration.cpp in Sources */,
02414BA71CE6ABCF00A8669F /* list_notifier.cpp in Sources */,
504CF8601EBCAE3600A9A4B6 /* sync_file.cpp in Sources */,
02414BA81CE6ABCF00A8669F /* results_notifier.cpp in Sources */,
02414BA91CE6ABCF00A8669F /* collection_notifications.cpp in Sources */,
02F59EE31C88F2BB007F774C /* transact_log_handler.cpp in Sources */,
@ -855,6 +899,7 @@
02F59EBF1C88F17D007F774C /* index_set.cpp in Sources */,
F63FF2C91C12469E00B3B8E0 /* js_realm.cpp in Sources */,
02F59EC51C88F17D007F774C /* shared_realm.cpp in Sources */,
504CF85E1EBCAE3600A9A4B6 /* network_reachability_observer.cpp in Sources */,
02F59EE21C88F2BB007F774C /* realm_coordinator.cpp in Sources */,
02F59EC41C88F17D007F774C /* schema.cpp in Sources */,
F63FF2CD1C12469E00B3B8E0 /* rpc.cpp in Sources */,

View File

@ -345,7 +345,6 @@ public:
static FunctionType create_constructor(ContextType);
static void set_sync_log_level(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &);
static void set_verify_servers_ssl_certificate(ContextType, FunctionType, ObjectType, size_t, const ValueType[], ReturnValue &);
// private
static void populate_sync_config(ContextType, ObjectType realm_constructor, ObjectType config_object, Realm::Config&);
@ -355,7 +354,6 @@ public:
MethodMap<T> const static_methods = {
{"setLogLevel", wrap<set_sync_log_level>},
{"setVerifyServersSslCertificate", wrap<set_verify_servers_ssl_certificate>}
};
};
@ -388,13 +386,6 @@ void SyncClass<T>::set_sync_log_level(ContextType ctx, FunctionType, ObjectType
realm::SyncManager::shared().set_log_level(log_level_2);
}
template<typename T>
void SyncClass<T>::set_verify_servers_ssl_certificate(ContextType ctx, FunctionType, ObjectType this_object, size_t argc, const ValueType arguments[], ReturnValue &return_value) {
validate_argument_count(argc, 1);
bool verify_servers_ssl_certificate = Value::validated_to_boolean(ctx, arguments[0]);
realm::SyncManager::shared().set_client_should_validate_ssl(verify_servers_ssl_certificate);
}
template<typename T>
void SyncClass<T>::populate_sync_config(ContextType ctx, ObjectType realm_constructor, ObjectType config_object, Realm::Config& config)
{
@ -446,10 +437,27 @@ void SyncClass<T>::populate_sync_config(ContextType ctx, ObjectType realm_constr
std::string raw_realm_url = Object::validated_get_string(ctx, sync_config_object, "url");
bool client_validate_ssl = true;
ValueType validate_ssl_temp = Object::get_property(ctx, sync_config_object, "validate_ssl");
if (!Value::is_undefined(ctx, validate_ssl_temp)) {
client_validate_ssl = Value::validated_to_boolean(ctx, validate_ssl_temp, "validate_ssl");
}
util::Optional<std::string> ssl_trust_certificate_path;
ValueType trust_certificate_path_temp = Object::get_property(ctx, sync_config_object, "ssl_trust_certificate_path");
if (!Value::is_undefined(ctx, trust_certificate_path_temp)) {
ssl_trust_certificate_path = std::string(Value::validated_to_string(ctx, trust_certificate_path_temp, "ssl_trust_certificate_path"));
}
else {
ssl_trust_certificate_path = util::none;
}
// FIXME - use make_shared
config.sync_config = std::shared_ptr<SyncConfig>(new SyncConfig{shared_user, raw_realm_url,
SyncSessionStopPolicy::AfterChangesUploaded,
std::move(bind), std::move(error_handler)});
std::move(bind), std::move(error_handler),
nullptr, util::none,
client_validate_ssl, ssl_trust_certificate_path});
config.schema_mode = SchemaMode::Additive;
config.path = realm::SyncManager::shared().path_for_realm(shared_user->identity(), raw_realm_url);

@ -1 +1 @@
Subproject commit 91b460fa5ad4083bdb5c59955cfd231bb2b25c54
Subproject commit 872a154b1bfd843f7dad98cab73e23a5aff2ee66