diff --git a/src/js_sync.hpp b/src/js_sync.hpp index bfdde397..2ea518f3 100644 --- a/src/js_sync.hpp +++ b/src/js_sync.hpp @@ -84,7 +84,7 @@ public: template void UserClass::get_server(ContextType ctx, ObjectType object, ReturnValue &return_value) { - std::string server = get_internal>(object)->get()->server_url; + std::string server = get_internal>(object)->get()->server_url(); return_value.set(server); } @@ -111,8 +111,8 @@ void UserClass::create_user(ContextType ctx, ObjectType this_object, size_t a SharedUser *user = new SharedUser(SyncManager::shared().get_user(Value::validated_to_string(ctx, arguments[1]), Value::validated_to_string(ctx, arguments[2]), + (std::string)Value::validated_to_string(ctx, arguments[0]), Value::validated_to_boolean(ctx, arguments[3]))); - user->get()->server_url = Value::validated_to_string(ctx, arguments[0]); return_value.set(create_object>(ctx, user)); } diff --git a/src/object-store b/src/object-store index d2ccd87a..1cf28ec0 160000 --- a/src/object-store +++ b/src/object-store @@ -1 +1 @@ -Subproject commit d2ccd87ac6312f3a75eaae3725892c89937f2207 +Subproject commit 1cf28ec004b20353c175feb669c8d84943282035 diff --git a/test.js b/test.js index 0985b301..035cfc14 100644 --- a/test.js +++ b/test.js @@ -26,9 +26,8 @@ const wildcard = require('wildcard'); var notifier_dir = './notifier'; mkdirp.sync(notifier_dir); -var access_token = 'ewoJImlkZW50aXR5IjogImFkbWluIiwKCSJhY2Nlc3MiOiBbInVwbG9hZCIsICJkb3dubG9hZCIsICJtYW5hZ2UiXQp9Cg==:DlFksxA+cJyEOc9bu6JwBUfDi4fJCagjAcIPPsoisjqfmOzSrk5Omuw0IkxCRU534p2+CAAj5IOH47DfObPtAA8q2DHguYDOKWYxyktS/6doPCqDHYN7k9EgUHdPTkESNkuPZbaVfXZTGzocB8m7+MaEXJde7FGPbh1sBz/+sPldnlAhnOqO5QbWzIEyoGHiOSg3V7UCh2H8kalr3tef7fkE2X65OBMgcarPvM5M6sPijOx2N5zrVrjL2wvguP9zS+g2ybFPUqV3DGv3S8cnGA+wVId/jCfGc2ujNhecunJdENH+/pL+0BTYHCFEWkY1WP1NUyti60FwRaXAtcYxeA=='; +// var access_token = 'ewoJImlkZW50aXR5IjogImFkbWluIiwKCSJhY2Nlc3MiOiBbInVwbG9hZCIsICJkb3dubG9hZCIsICJtYW5hZ2UiXQp9Cg==:DlFksxA+cJyEOc9bu6JwBUfDi4fJCagjAcIPPsoisjqfmOzSrk5Omuw0IkxCRU534p2+CAAj5IOH47DfObPtAA8q2DHguYDOKWYxyktS/6doPCqDHYN7k9EgUHdPTkESNkuPZbaVfXZTGzocB8m7+MaEXJde7FGPbh1sBz/+sPldnlAhnOqO5QbWzIEyoGHiOSg3V7UCh2H8kalr3tef7fkE2X65OBMgcarPvM5M6sPijOx2N5zrVrjL2wvguP9zS+g2ybFPUqV3DGv3S8cnGA+wVId/jCfGc2ujNhecunJdENH+/pL+0BTYHCFEWkY1WP1NUyti60FwRaXAtcYxeA=='; // var admin_user = new Realm.Sync.User.adminUser('http://127.0.0.1:9080/', access_token); -// Realm.Sync.setLogLevel('error'); // Realm.Sync.setGlobalListener(notifier_dir, 'realm://127.0.0.1:9080', admin_user, // (name) => { // console.log('filter: ' + name); @@ -41,6 +40,8 @@ var access_token = 'ewoJImlkZW50aXR5IjogImFkbWluIiwKCSJhY2Nlc3MiOiBbInVwbG9hZCIs // ); // console.log('global notifier listening...'); +Realm.Sync.setLogLevel('error'); + function createObjects(error, user) { console.log(user.server); console.log(user.token); @@ -76,7 +77,6 @@ function createObjects(error, user) { prompt.get(['int'], create); } -console.log(Realm.Sync.User.all); if (Realm.Sync.User.all.length) { console.log('Using persisted user'); createObjects(undefined, Realm.Sync.User.all[0]);