@Ian_Ward Thank you so much for the feedback. I am sorry, return realm;
was inside of function and I was making the code look compact and nice, as a result I forgot to remove that part in this post.
Q: are you trying to sync the writes on your local realm to cloud?
A: Exactly, I am trying to have sync between local realm with cloud, unfortunately I can’t fully understand how to accomplish this. I tried with subscribe function from Realm, but I can’t figure out why still it doesn’t keep my local Realm database always synced with Cloud Realm.
Q: And you are saying this is not working when you come back online?
A: With above code, all of the entries are being uploaded only to Realm Cloud and I can’t see the local Realm Database with those uploaded entries. So, the main idea is that local Realm database(let’s say endpoint) shall be always in sync with Realm Cloud.
Q: Can you post some logs here?
A: Below are the logs:
Realm sync client ([realm-core-5.23.8], [realm-sync-4.9.5])
Supported protocol versions: 26-30
Platform: Linux Linux 4.15.0-91-generic #92~16.04.1-Ubuntu SMP Fri Feb 28 14:57:22 UTC 2020 x86_64
Build mode: Release
Config param: max_open_files = 256
Config param: one_connection_per_session = 1
Config param: connect_timeout = 120000 ms
Config param: connection_linger_time = 30000 ms
Config param: ping_keepalive_period = 60000 ms
Config param: pong_keepalive_timeout = 120000 ms
Config param: fast_reconnect_limit = 60000 ms
Config param: disable_upload_compaction = 0
Config param: tcp_no_delay = 0
Config param: disable_sync_to_disk = 0
User agent string: 'RealmSync/4.9.5 (Linux Linux 4.15.0-91-generic #92~16.04.1-Ubuntu SMP Fri Feb 28 14:57:22 UTC 2020 x86_64) RealmDotNet/4.3.0.0 (.NET Core 3.1.2) ’
Connection[1]: WebSocket::Websocket()
Connection[1]: Session[1]: Binding ‘/home/cool/realm-object-server/90adb87d-8624-4bee-beba-946c0ad1f66f/realms%3A%2F%2Fptx-test.de1a.cloud.realm.io
%2F%7E%2FmyRealm’ to ‘/4219523c68c25db5b31ff2b3e48face4/myRealm’
Connection[1]: Session[1]: Activating
Connection[1]: Session[1]: client_reset_config = false, Realm exists = true, async open = false, client reset = false
Opening Realm file: /home/cool/realm-object-server/90adb87d-8624-4bee-beba-946c0ad1f/realms%3A%2F%2FMY-REALM.cloud.realm.io
%2F%7E%2FmyRealm
Connection[1]: Session[1]: client_file_ident = 2, client_file_ident_salt = 13912707436647382
Connection[1]: Session[1]: Progress handler called, downloaded = 57, downloadable(total) = 57, uploaded = 873, uploadable = 930, reliable_download_progress = 0, snapshot version = 33
Connection[1]: Resolving 'MY-REALM.cloud.realm.io:443'
Connection[1]: Connecting to endpoint ‘3.120.234.243:443’ (1/3)
Connection[1]: Connected to endpoint ‘3.120.234.243:443’ (from ‘192.168.0.104:414’)
Connection[1]: Verifying server SSL certificate using root certificates, host name = MY-REALM.cloud.realm.io
, server port = 443, certificate =
-----BEGIN CERTIFICATE-----
MII… DUE TO CONFIDENTIAL INFO, THE REST OF CERTIFICATE WAS REMOVED
-----END CERTIFICATE-----
Connection[1]: Verifying server SSL certificate using 155 root certificates
Connection[1]: Server SSL certificate verified using root certificate(29):
-----BEGIN CERTIFICATE-----
MII… DUE TO CONFIDENTIAL INFO, THE REST OF CERTIFICATE WAS REMOVED
-----END CERTIFICATE-----
Connection[1]: WebSocket::initiate_client_handshake()
Connection[1]: WebSocket::handle_http_response_received()
Connection[1]: Negotiated protocol version: 30
Connection[1]: Will emit a ping in 43708 milliseconds
Connection[1]: Session[1]: Sending: BIND(path=‘/4219523c68c25db5b31ff2b3e48face4/myRealm’, signed_user_token_size=786, need_client_file_ident=0, is_subserver=0)
Connection[1]: Session[1]: Sending: IDENT(client_file_ident=2, client_file_ident_salt=1391270743664738180, scan_server_version=15, scan_client_version=30, latest_server_version=15, latest_server_version_salt=7570085601498466528)
Connection[1]: Session[1]: Sending: MARK(request_ident=2)
Connection[1]: Session[1]: Received: DOWNLOAD(download_server_version=16, download_client_version=33, latest_server_version=16, latest_server_version_salt=7570085601498466528, upload_client_version=33, upload_server_version=15, downloadable_bytes=0, num_changesets=0, …)
Connection[1]: Session[1]: Progress handler called, downloaded = 57, downloadable(total) = 57, uploaded = 930, uploadable = 930, reliable_download_progress = 1, snapshot version = 34
Connection[1]: Session[1]: Received: MARK(request_ident=2)
Connection[1]: Session[1]: Sending: UPLOAD(progress_client_version=34, progress_server_version=16, locked_server_version=16, num_changesets=0)
ooooooooo
ooooooooo2
ooooooooo2
ooooooooo2
ooooooooo2
ooooooooo2
3333333
3333333
3333333
1111
22220000000000
1111
1111
1111
1111
1111
Connection[1]: Session[1]: Sending: UPLOAD(progress_client_version=35, progress_server_version=16, locked_server_version=16, num_changesets=1)
Connection[1]: Session[1]: Upload compaction: original size = 57, compacted size = 57
Connection[1]: Session[1]: Progress handler called, downloaded = 57, downloadable(total) = 57, uploaded = 930, uploadable = 987, reliable_download_progress = 1, snapshot version = 35