realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.67k stars 561 forks source link

[Realm.Sync.Client.Network] Websocket Connection Fails with 308 Permanent Redirect Error #6741

Open fanismahmalat opened 2 weeks ago

fanismahmalat commented 2 weeks ago

How frequently does the bug occur?

Always

Description

I'm encountering an issue with Realm Sync on React Native (react@18.2.0, react-native@0.74.2) using @realm/react@^0.8.0 where the websocket connection fails due to an unexpected HTTP response. The error log indicates that the client expects a "101 Switching Protocols" response but receives a "308 Permanent Redirect" instead. This error is also mentioned in MongoDB Developer community forum: https://www.mongodb.com/community/forums/t/realm-sync-client-network-error/285467

Please advise on how to resolve this issue or if any additional information is needed.

Thank you!

Stacktrace & log output

[Realm.Sync.Client.Network - error] Websocket: Expected HTTP response 101 Switching Protocols, but received:
HTTP/1.1 308 Permanent Redirect
cache-control: no-cache, no-store, must-revalidate
connection: close
content-length: 0
date: Thu, 20 Jun 2024 15:22:40 GMT
location: https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/realm-sync
server: mdbws
strict-transport-security: max-age=31536000; includeSubdomains;
vary: Origin
x-appservices-request-id: 667449409982441e56baf4e0
x-frame-options: DENY
x-xgen-up-proto: HTTP/1.1

Can you reproduce the bug?

Always

Reproduction Steps

  1. Attempt to establish a connection using Realm Sync.
  2. Observe the error in the client logs.

Version

^12.11.0

What services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

Mac OS Sonoma 14.5 (23F79) with Simulator iPhone 15 Pro

Cocoapods version

1.15.2

sync-by-unito[bot] commented 2 weeks ago

➤ PM Bot commented:

Jira ticket: RJS-2840

nirinchev commented 2 weeks ago

This should be a transient error and the session should reconnect to the correct endpoint shortly after getting that error.

fanismahmalat commented 2 weeks ago

@nirinchev Unfortunately, it does not. It actually freezes the app including metro.. here's a recording of the simulator:

https://github.com/realm/realm-js/assets/39618933/ed4acd86-566f-4b6e-8c61-4c0f2a9d5153

It might not be clear in the video, but I am trying to click on react native's error or click the sign out button and the app is not responding. I get the above mentioned error twice and that's it. Should I change the configuration on mongodb.com or something is wrong with my repository? I really don't know..

Is there a way to manually add the correct endpoint? Where can I get the correct endpoint from?

nirinchev commented 2 weeks ago

Interesting, can you try and capture trace-level logs from your app and share them with us? Here's the docs for how to increase the log verbosity: https://www.mongodb.com/docs/atlas/device-sdks/sdk/react-native/logging/

fanismahmalat commented 2 weeks ago

Setting the log level to trace, crashes the app instantly when opening but gives the following logs

 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    User data size: 7192
 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    Free space size: 9168
 LOG  [Realm.Storage - debug] DB: 9729 Thread 0x16d76f000:    History size: 24
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: Start read 13003: 156 ref 6224
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: End transaction 13003
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: Start read 13003: 156 ref 6224
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: End transaction 13003
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: Start read 12066: 156 ref 6224
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: acquire writemutex
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: writemutex acquired
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: Tr 12066: Acquired write lock in 495 us
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: Tr 12066: Already on version: 156
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: Tr 12066: Promote to write: 156 -> 156
 LOG  [Realm.Storage.Transaction - debug] DB: 9729 Thread 0x16d76f000: Initiate commit version: 157
 LOG  [Realm.Storage.Transaction - debug] DB: 9729 Thread 0x16d76f000: Commit of size 328 done in 3234 us ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: writemutex released
 LOG  [Realm.Storage.Transaction - trace] DB: 9729 Thread 0x16d76f000: End transaction 12066
 LOG  [Realm.Storage - detail] DB: 9729 Thread 0x16d76f000: DB closed
 LOG  [Realm.Storage - detail] DB: 3905 Thread 0x16d76f000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/6DEAFC59-E3AF-47E8-BD27-53EFACDFC505/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    User data size: 7192
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    Free space size: 9168
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    History size: 24
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: Start read 39907: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: End transaction 39907
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: Start read 39907: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: End transaction 39907
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: Start read 39907: 157 ref 6424
 LOG  [Realm.Storage.Query - debug] DB: 3905 Thread 0x16d76f000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 3905 Thread 0x16d76f000: Query first found: ObjKey(0), Duration: 2 us
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: End transaction 39907
 LOG  [Realm.Storage - detail] DB: 3905 Thread 0x16d76f000: DB closed
 LOG  [Realm.Storage - detail] DB: 3905 Thread 0x16d76f000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/6DEAFC59-E3AF-47E8-BD27-53EFACDFC505/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    User data size: 7192
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    Free space size: 9168
 LOG  [Realm.Storage - debug] DB: 3905 Thread 0x16d76f000:    History size: 24
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: Start read 14002: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: End transaction 14002
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: Start read 14002: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: End transaction 14002
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: Start read 14171: 157 ref 6424
 LOG  [Realm.Storage.Query - debug] DB: 3905 Thread 0x16d76f000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 3905 Thread 0x16d76f000: Query first found: ObjKey(0), Duration: 1 us
 LOG  [Realm.Storage.Transaction - trace] DB: 3905 Thread 0x16d76f000: End transaction 14171
 LOG  [Realm.Storage - detail] DB: 3905 Thread 0x16d76f000: DB closed
 LOG  [Realm.Storage - detail] DB: 14273 Thread 0x16d76f000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/6DEAFC59-E3AF-47E8-BD27-53EFACDFC505/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    User data size: 7192
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    Free space size: 9168
 LOG  [Realm.Storage - debug] DB: 14273 Thread 0x16d76f000:    History size: 24
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: Start read 13887: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: End transaction 13887
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: Start read 13887: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: End transaction 13887
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: Start read 14089: 157 ref 6424
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: acquire writemutex
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: writemutex acquired
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: Tr 14089: Acquired write lock in 71 us
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: Tr 14089: Already on version: 157
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: Tr 14089: Promote to write: 157 -> 157
 LOG  [Realm.Storage.Query - debug] DB: 14273 Thread 0x16d76f000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 14273 Thread 0x16d76f000: Query first found: ObjKey(0), Duration: 3 us
 LOG  [Realm.Storage.Object - debug] DB: 14273 Thread 0x16d76f000: Mutating anonymous object 'UserMetadata'[ObjKey(0)]
 LOG  [Realm.Storage.Object - trace] DB: 14273 Thread 0x16d76f000:    Insert "/Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB ..." in ['local_realm_paths'] at position 1
 LOG  [Realm.Storage.Transaction - debug] DB: 14273 Thread 0x16d76f000: Initiate commit version: 158
 LOG  [Realm.Storage.Transaction - debug] DB: 14273 Thread 0x16d76f000: Commit of size 1080 done in 1560 us ref 6648
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: writemutex released
 LOG  [Realm.Storage.Transaction - trace] DB: 14273 Thread 0x16d76f000: End transaction 14089
 LOG  [Realm.Storage - detail] DB: 14273 Thread 0x16d76f000: DB closed
 LOG  [Realm.Storage - detail] DB: 14433 Thread 0x16d76f000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/6DEAFC59-E3AF-47E8-BD27-53EFACDFC505/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    User data size: 7480
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    Free space size: 8864
 LOG  [Realm.Storage - debug] DB: 14433 Thread 0x16d76f000:    History size: 40
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: Start read 43947: 158 ref 6648
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: End transaction 43947
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: Start read 43947: 158 ref 6648
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: End transaction 43947
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: Start read 43947: 158 ref 6648
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: acquire writemutex
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: writemutex acquired
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: Tr 43947: Acquired write lock in 72 us
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: Tr 43947: Already on version: 158
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: Tr 43947: Promote to write: 158 -> 158
 LOG  [Realm.Storage.Query - debug] DB: 14433 Thread 0x16d76f000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 14433 Thread 0x16d76f000: Query first found: ObjKey(0), Duration: 1 us
 LOG  [Realm.Storage.Transaction - debug] DB: 14433 Thread 0x16d76f000: Initiate commit version: 159
 LOG  [Realm.Storage.Transaction - debug] DB: 14433 Thread 0x16d76f000: Commit of size 328 done in 1506 us ref 6872
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: writemutex released
 LOG  [Realm.Storage.Transaction - trace] DB: 14433 Thread 0x16d76f000: End transaction 43947
 LOG  [Realm.Storage - detail] DB: 14433 Thread 0x16d76f000: DB closed
 LOG  [Realm.Storage - detail] DB: 19009 Thread 0x16d76f000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/6DEAFC59-E3AF-47E8-BD27-53EFACDFC505/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    User data size: 7480
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    Free space size: 8880
 LOG  [Realm.Storage - debug] DB: 19009 Thread 0x16d76f000:    History size: 24
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: Start read 57450: 159 ref 6872
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: End transaction 57450
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: Start read 57450: 159 ref 6872
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: End transaction 57450
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: Start read 57450: 159 ref 6872
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: acquire writemutex
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: writemutex acquired
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: Tr 57450: Acquired write lock in 68 us
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: Tr 57450: Already on version: 159
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: Tr 57450: Promote to write: 159 -> 159
 LOG  [Realm.Storage.Query - debug] DB: 19009 Thread 0x16d76f000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 19009 Thread 0x16d76f000: Query first found: ObjKey(0), Duration: 1 us
 LOG  [Realm.Storage.Transaction - debug] DB: 19009 Thread 0x16d76f000: Initiate commit version: 160
 LOG  [Realm.Storage.Transaction - debug] DB: 19009 Thread 0x16d76f000: Commit of size 328 done in 1383 us ref 11568
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: writemutex released
 LOG  [Realm.Storage.Transaction - trace] DB: 19009 Thread 0x16d76f000: End transaction 57450
 LOG  [Realm.Storage - detail] DB: 19009 Thread 0x16d76f000: DB closed
 LOG  [Realm.Storage - detail] DB: 2561 Thread 0x16d76f000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/6DEAFC59-E3AF-47E8-BD27-53EFACDFC505/Documents/mongodb-realm/app_id/667448b26df03a334b6b9a22/flx_sync_default.realm
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    User data size: 4784
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    Free space size: 11112
 LOG  [Realm.Storage - debug] DB: 2561 Thread 0x16d76f000:    History size: 488
 LOG  [Realm.Sync.Client.Network - trace] Default event loop: start()
 LOG  [Realm.Sync.Client.Session - info] Realm sync client ([realm-core-14.10.0])
 LOG  [Realm.Sync.Client.Session - debug] Supported protocol versions: 2-13
 LOG  [Realm.Sync.Client.Session - info] Platform: iOS Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64
 LOG  [Realm.Sync.Client.Session - debug] Build mode: Release
 LOG  [Realm.Sync.Client.Session - debug] Config param: one_connection_per_session = false
 LOG  [Realm.Sync.Client.Session - debug] Config param: connect_timeout = 120000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: connection_linger_time = 30000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: ping_keepalive_period = 60000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: pong_keepalive_timeout = 120000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: fast_reconnect_limit = 60000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: disable_upload_compaction = false
 LOG  [Realm.Sync.Client.Session - debug] Config param: disable_sync_to_disk = false
 LOG  [Realm.Sync.Client.Session - debug] Config param: reconnect backoff info: max_delay: 300000 ms, initial_delay: 1000 ms, multiplier: 2, jitter: 1/4
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start read 15013: 119 ref 4976
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: End transaction 15013
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start read 58139: 119 ref 4976
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: End transaction 58139
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start read 43947: 119 ref 4976
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: End transaction 43947
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start read 58139: 119 ref 4976
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: End transaction 58139
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start frozen 15013: 119 ref 4976
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: End transaction 15013
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: acquire writemutex
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: writemutex acquired
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start write 15917: 119 ref 4976
 LOG  [Realm.Storage.Object - debug] DB: 2561 Thread 0x16d76f000: Create object 'flx_subscription_sets' with primary key 25
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start read 16584: 119 ref 4976
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'snapshot_version' to 119
 LOG  [Realm.Storage.Object - debug] DB: 2561 Thread 0x16d76f000: Mutating object 'flx_subscription_sets' with primary key 25
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Insert embedded object 'flx_subscriptions' in ['subscriptions'] at position 0
 LOG  [Realm.Storage.Object - debug] DB: 2561 Thread 0x16d76f000: Mutating object 'flx_subscriptions' with path 'flx_subscription_sets[25]['subscriptions'][FIRST]'
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'id' to oid(667448fa374a7e481d59f07a)
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'created_at' to 2024-06-20 15:21:30.737297000
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'updated_at' to 2024-06-21 11:46:19.223890000
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'object_class' to "Profile"
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'query' to "TRUEPREDICATE"
 LOG  [Realm.Storage.Object - debug] DB: 2561 Thread 0x16d76f000: Mutating object 'flx_subscription_sets' with primary key 25
 LOG  [Realm.Storage.Object - trace] DB: 2561 Thread 0x16d76f000:    Set 'state' to 1
 LOG  [Realm.Storage.Transaction - debug] DB: 2561 Thread 0x16d76f000: Initiate commit version: 120
 LOG  [Realm.Storage.Transaction - debug] DB: 2561 Thread 0x16d76f000: Commit of size 3904 done in 1643 us ref 9152
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: writemutex released
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: Start frozen 44102: 120 ref 9152
 LOG  [Realm.Storage.Transaction - trace] DB: 2561 Thread 0x16d76f000: End transaction 44102
kneth commented 2 weeks ago

@fanismahmalat

Setting the log level to trace, crashes the app instantly

Please try a lower log level. And do you have a stack trace from the crash? Is it possible for you to share (privately) a reproduction case?

fanismahmalat commented 2 weeks ago

Actually, the app is not crashing - it becomes unresponsive! Here's debug level logs: I am using custom-token authentication with Firebase Authentication as the third-party auth service.

 LOG  [Realm.Storage - detail] DB: 39233 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    User data size: 7752
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    Free space size: 8576
 LOG  [Realm.Storage - debug] DB: 39233 Thread 0x16c2cb000:    History size: 56
 LOG  [Realm.Storage.Transaction - debug] DB: 39233 Thread 0x16c2cb000: Initiate commit version: 167
 LOG  [Realm.Storage.Transaction - debug] DB: 39233 Thread 0x16c2cb000: Commit of size 328 done in 2833 us ref 9888
 LOG  [Realm.Storage - detail] DB: 39233 Thread 0x16c2cb000: DB closed
 LOG  [Realm.Storage - detail] DB: 51937 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    User data size: 7728
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    Free space size: 8632
 LOG  [Realm.Storage - debug] DB: 51937 Thread 0x16c2cb000:    History size: 24
 LOG  [Realm.Storage.Query - debug] DB: 51937 Thread 0x16c2cb000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 51937 Thread 0x16c2cb000: Query first found: ObjKey(0), Duration: 2 us
 LOG  [Realm.Storage - detail] DB: 51937 Thread 0x16c2cb000: DB closed
 LOG  [Realm.Storage - detail] DB: 29793 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    User data size: 7728
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    Free space size: 8632
 LOG  [Realm.Storage - debug] DB: 29793 Thread 0x16c2cb000:    History size: 24
 LOG  [Realm.Storage.Query - debug] DB: 29793 Thread 0x16c2cb000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 29793 Thread 0x16c2cb000: Query first found: ObjKey(0), Duration: 0 us
 LOG  [Realm.Storage - detail] DB: 29793 Thread 0x16c2cb000: DB closed
 LOG  [Realm.Storage - detail] DB: 13249 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    User data size: 7728
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    Free space size: 8632
 LOG  [Realm.Storage - debug] DB: 13249 Thread 0x16c2cb000:    History size: 24
 LOG  [Realm.Storage.Query - debug] DB: 13249 Thread 0x16c2cb000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 13249 Thread 0x16c2cb000: Query first found: ObjKey(0), Duration: 1 us
 LOG  [Realm.Storage.Transaction - debug] DB: 13249 Thread 0x16c2cb000: Initiate commit version: 168
 LOG  [Realm.Storage.Transaction - debug] DB: 13249 Thread 0x16c2cb000: Commit of size 328 done in 1517 us ref 10088
 LOG  [Realm.Storage - detail] DB: 13249 Thread 0x16c2cb000: DB closed
 LOG  [Realm.Storage - detail] DB: 14337 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    User data size: 7728
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    Free space size: 8632
 LOG  [Realm.Storage - debug] DB: 14337 Thread 0x16c2cb000:    History size: 24
 LOG  [Realm.Storage.Query - debug] DB: 14337 Thread 0x16c2cb000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 14337 Thread 0x16c2cb000: Query first found: ObjKey(0), Duration: 1 us
 LOG  [Realm.Storage.Transaction - debug] DB: 14337 Thread 0x16c2cb000: Initiate commit version: 169
 LOG  [Realm.Storage.Transaction - debug] DB: 14337 Thread 0x16c2cb000: Commit of size 328 done in 1138 us ref 10288
 LOG  [Realm.Storage - detail] DB: 14337 Thread 0x16c2cb000: DB closed
 LOG  [Realm.Storage - detail] DB: 40833 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/server-utility/metadata/sync_metadata.realm
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    User data size: 7728
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    Free space size: 8632
 LOG  [Realm.Storage - debug] DB: 40833 Thread 0x16c2cb000:    History size: 24
 LOG  [Realm.Storage.Query - debug] DB: 40833 Thread 0x16c2cb000: Query find first: 'identity == "667448b26df03a334b6b9a22"'
 LOG  [Realm.Storage.Query - debug] DB: 40833 Thread 0x16c2cb000: Query first found: ObjKey(0), Duration: 1 us
 LOG  [Realm.Storage.Transaction - debug] DB: 40833 Thread 0x16c2cb000: Initiate commit version: 170
 LOG  [Realm.Storage.Transaction - debug] DB: 40833 Thread 0x16c2cb000: Commit of size 328 done in 1301 us ref 10488
 LOG  [Realm.Storage - detail] DB: 40833 Thread 0x16c2cb000: DB closed
 LOG  [Realm.Storage - detail] DB: 18049 Thread 0x16c2cb000: Open file: /Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/667448b26df03a334b6b9a22/flx_sync_default.realm
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    Number of participants: 1
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    Durability: Full
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    EncryptionKey: no
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    File size: 16384
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    User data size: 4872
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    Free space size: 10584
 LOG  [Realm.Storage - debug] DB: 18049 Thread 0x16c2cb000:    History size: 928
 LOG  [Realm.Sync.Client.Session - info] Realm sync client ([realm-core-14.10.0])
 LOG  [Realm.Sync.Client.Session - debug] Supported protocol versions: 2-13
 LOG  [Realm.Sync.Client.Session - info] Platform: iOS Darwin 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:19:05 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8112 arm64
 LOG  [Realm.Sync.Client.Session - debug] Build mode: Release
 LOG  [Realm.Sync.Client.Session - debug] Config param: one_connection_per_session = false
 LOG  [Realm.Sync.Client.Session - debug] Config param: connect_timeout = 120000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: connection_linger_time = 30000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: ping_keepalive_period = 60000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: pong_keepalive_timeout = 120000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: fast_reconnect_limit = 60000 ms
 LOG  [Realm.Sync.Client.Session - debug] Config param: disable_upload_compaction = false
 LOG  [Realm.Sync.Client.Session - debug] Config param: disable_sync_to_disk = false
 LOG  [Realm.Sync.Client.Session - debug] Config param: reconnect backoff info: max_delay: 300000 ms, initial_delay: 1000 ms, multiplier: 2, jitter: 1/4
 LOG  [Realm.Storage.Object - debug] DB: 18049 Thread 0x16c2cb000: Create object 'flx_subscription_sets' with primary key 27
 LOG  [Realm.Storage.Object - debug] DB: 18049 Thread 0x16c2cb000: Mutating object 'flx_subscription_sets' with primary key 27
 LOG  [Realm.Storage.Object - debug] DB: 18049 Thread 0x16c2cb000: Mutating object 'flx_subscriptions' with path 'flx_subscription_sets[27]['subscriptions'][FIRST]'
 LOG  [Realm.Storage.Object - debug] DB: 18049 Thread 0x16c2cb000: Mutating object 'flx_subscription_sets' with primary key 27
 LOG  [Realm.Storage.Transaction - debug] DB: 18049 Thread 0x16c2cb000: Initiate commit version: 135
 LOG  [Realm.Storage.Transaction - debug] DB: 18049 Thread 0x16c2cb000: Commit of size 3824 done in 3700 us ref 14144
 LOG  File: _layout.tsx, Line: 63, isLoggedIn true
 LOG  File: _layout.tsx, Line: 64, identities [{"id": "zjxjK7Jk4xZdG9oqUzcXtWrklRD2", "providerType": "custom-token"}]
 LOG  File: index.tsx, Line: 11, fromRealm false
 LOG  File: _layout.tsx, Line: 33, splash
 LOG  [Realm.Sync.Client.Session - info] Connection[1] Session[1]: Binding '/Users/fanis/Library/Developer/CoreSimulator/Devices/B1238306-040B-46F6-8AD2-9CB9FA6C606A/data/Containers/Data/Application/207CAD4A-435D-49D5-9471-9A5B186AA534/Documents/mongodb-realm/app_id/667448b26df03a334b6b9a22/flx_sync_default.realm' to ''
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: Activating
 LOG  [Realm.Sync.Client.Session - info] Connection[1] Session[1]: client_reset_config = false, Realm exists = true
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: client_file_ident = 18, client_file_ident_salt = 272552483739139662
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: last_version_available  = 134
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: progress_download_server_version = 44
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: progress_download_client_version = 10
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: progress_upload_server_version = 40
 LOG  [Realm.Sync.Client.Session - debug] Connection[1] Session[1]: progress_upload_client_version = 117
 LOG  [Realm.Storage.Query - debug] DB: 18049 Thread 0x16c613000: Query find all: '(state == 3 or state == 6)', limit = -1
 LOG  [Realm.Storage.Query - debug] DB: 18049 Thread 0x16c613000: Query found: 1, Duration: 14 us
 LOG  [Realm.Storage.Query - debug] DB: 18049 Thread 0x16c613000: Query find all: 'state == 6', limit = -1
 LOG  [Realm.Storage.Query - debug] DB: 18049 Thread 0x16c613000: Query found: 0, Duration: 1 us
 LOG  [Realm.Sync.Client.Session - info] Connection[1] Connecting to 'wss://ws.services.cloud.mongodb.com:443/api/client/v2.0/app/app_id/realm-sync'
 LOG  [Realm.Sync.Client.Network - debug] WebSocket::Websocket()
 LOG  [Realm.Sync.Client.Network - detail] Resolving 'ws.services.cloud.mongodb.com:443'
 LOG  [Realm.App - debug] App: log_in_with_credentials: app_id: app_id
 LOG  [Realm.App - debug] App: version info: platform: iOS  version: 17.2 - sdk: JS - sdk version: 12.11.0 - core version: 14.10.0
 LOG  [Realm.App - debug] App: request location: https://services.cloud.mongodb.com/api/client/v2.0/app/app_id/location
 LOG  [Realm.App - debug] App: log_in_with_credentials: app_id: app_id
 LOG  [Realm.App - debug] App: version info: platform: iOS  version: 17.2 - sdk: JS - sdk version: 12.11.0 - core version: 14.10.0
 LOG  [Realm.App - debug] App: request location: https://services.cloud.mongodb.com/api/client/v2.0/app/app_id/location
 LOG  [Realm.App - debug] App: log_in_with_credentials: app_id: app_id
 LOG  [Realm.App - debug] App: version info: platform: iOS  version: 17.2 - sdk: JS - sdk version: 12.11.0 - core version: 14.10.0
 LOG  [Realm.App - debug] App: request location: https://services.cloud.mongodb.com/api/client/v2.0/app/app_id/location
 LOG  [Realm.Sync.Client.Network - detail] Connecting to endpoint '18.153.201.179:443' (1/3)
 LOG  [Realm.Sync.Client.Network - info] Connected to endpoint '18.153.201.179:443' (from '192.168.10.11:60254')
 LOG  [Realm.Sync.Client.Network - debug] WebSocket::initiate_client_handshake()
 LOG  [Realm.App - debug] App: update_hostname: https://eu-west-1.aws.services.cloud.mongodb.com | wss://eu-west-1.aws.ws.services.cloud.mongodb.com | https://services.cloud.mongodb.com
 LOG  [Realm.App - debug] App: send_request(after location update): POST https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/auth/providers/custom-token/login
 LOG  [Realm.App - debug] App: update_hostname: https://eu-west-1.aws.services.cloud.mongodb.com | wss://eu-west-1.aws.ws.services.cloud.mongodb.com | https://services.cloud.mongodb.com
 LOG  [Realm.App - debug] App: send_request(after location update): POST https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/auth/providers/custom-token/login
 LOG  [Realm.App - debug] App: update_hostname: https://eu-west-1.aws.services.cloud.mongodb.com | wss://eu-west-1.aws.ws.services.cloud.mongodb.com | https://services.cloud.mongodb.com
 LOG  [Realm.App - debug] App: send_request(after location update): POST https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/auth/providers/custom-token/login
 LOG  [Realm.Sync.Client.Network - debug] WebSocket::handle_http_response_received()
[koumbaras] [Realm.Sync.Client.Network - error] Websocket: Expected HTTP response 101 Switching Protocols, but received:
HTTP/1.1 308 Permanent Redirect
cache-control: no-cache, no-store, must-revalidate
connection: close
content-length: 0
date: Fri, 21 Jun 2024 15:21:58 GMT
location: https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/realm-sync
server: mdbws
strict-transport-security: max-age=31536000; includeSubdomains;
vary: Origin
x-appservices-request-id: 66759a96ac265500b09687a2
x-frame-options: DENY
x-xgen-up-proto: HTTP/1.1
 ERROR  [Realm.Sync.Client.Network - error] Websocket: Expected HTTP response 101 Switching Protocols, but received:
HTTP/1.1 308 Permanent Redirect
cache-control: no-cache, no-store, must-revalidate
connection: close
content-length: 0
date: Fri, 21 Jun 2024 15:21:58 GMT
location: https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/realm-sync
server: mdbws
strict-transport-security: max-age=31536000; includeSubdomains;
vary: Origin
x-appservices-request-id: 66759a96ac265500b09687a2
x-frame-options: DENY
x-xgen-up-proto: HTTP/1.1
 LOG  [Realm.Sync.Client.Session - info] Connection[1] Closing the websocket with error code=WebSocket: Moved Permanently, message='Bad WebSocket response 308 permanent redirect', was_clean=true
 LOG  [Realm.App - debug] App: refresh_access_token: user_id: 667448b26df03a334b6b9a22 (updating location)
 LOG  [Realm.App - debug] App: request location: https://eu-west-1.aws.services.cloud.mongodb.com/api/client/v2.0/app/app_id/location
 LOG  [Realm.Sync.Client.Session - detail] Connection[1] Allowing reconnection in 822 milliseconds
feyton commented 1 week ago

I am facing the same issue. Any fix yet

fanismahmalat commented 1 week ago

I am facing the same issue. Any fix yet

Nothing yet…

kneth commented 1 week ago

@fanismahmalat @feyton

There is a server-side fix out, and please try again. If it still causes problems for you, please paste the relevant section of the log so we can investigate.

feyton commented 1 week ago

@fanismahmalat @feyton

There is a server-side fix out, and please try again. If it still causes problems for you, please paste the relevant section of the log so we can investigate.

I am now able to sync the database. Thank you. But I have another persistent issue of the useUser() and app.currentUser returning an empty object {}, and I am unable to access the user information like name and email after login. I am able to see the users in the UI though.

fanismahmalat commented 6 days ago

@fanismahmalat @feyton There is a server-side fix out, and please try again. If it still causes problems for you, please paste the relevant section of the log so we can investigate.

I am now able to sync the database. Thank you. But I have another persistent issue of the useUser() and app.currentUser returning an empty object {}, and I am unable to access the user information like name and email after login. I am able to the users in the UI though.

Same for me. I don't get any identities from useUser

feyton commented 6 days ago

@fanismahmalat @feyton There is a server-side fix out, and please try again. If it still causes problems for you, please paste the relevant section of the log so we can investigate.

I am now able to sync the database. Thank you. But I have another persistent issue of the useUser() and app.currentUser returning an empty object {}, and I am unable to access the user information like name and email after login. I am able to the users in the UI though.

Same for me. I don't get any identities from useUser

I was able to find a solution to this from this other issue: https://github.com/realm/realm-js/issues/1155#issuecomment-316822458

The code that worked for is this:

const userData = useUser()

const userId = userData?.id  //This logs the correct id as mentioned in the above issue. These are proxy properties since this user is a react state
const userProfile = user?.profile 

console.log(userProfile)
/*
{"email": "t***********e@**ail.com", "first_name": "Name", "last_name": "Name", "name": "Name Name", "picture": "link to image"}
*/
// I am using Google Authentication with react native and this resolved my issue.
// JSX here

@fanismahmalat Credit to: @fealebenpae

fanismahmalat commented 6 days ago

@fanismahmalat @feyton

There is a server-side fix out, and please try again. If it still causes problems for you, please paste the relevant section of the log so we can investigate.

I am now able to sync the database. Thank you. But I have another persistent issue of the useUser() and app.currentUser returning an empty object {}, and I am unable to access the user information like name and email after login. I am able to the users in the UI though.

Same for me. I don't get any identities from useUser

I was able to find a solution to this from this other issue:

https://github.com/realm/realm-js/issues/1155#issuecomment-316822458

The code that worked for is this:


const userData = useUser()

const userId = userData?.id  //This logs the correct id as mentioned in the above issue. These are proxy properties since this user is a react state

const userProfile = user?.profile 

console.log(userProfile)

/*

{"email": "t***********e@**ail.com", "first_name": "Name", "last_name": "Name", "name": "Name Name", "picture": "link to image"}

*/

// I am using Google Authentication with react native and this resolved my issue.

// JSX here

@fanismahmalat

Credit to: @fealebenpae

So the issue is with destructuring the data from useUser? Seems odd.. Also, I was able to print the returned objects from useUser before

fanismahmalat commented 6 days ago

It seems that my UI freezes after all... It does not respond to any clicks etc... Are there any performance related issues when using Realm?

fanismahmalat commented 5 days ago

I tried removing realm and @realm/react and the app does not freeze. Seems that there's a performance implication? Is it known? @kneth

feyton commented 5 days ago

I tried removing realm and @realm/react and the app does not freeze. Seems that there's a performance implication? Is it known? @kneth

On my side, there was no performance implications when I destructured the useUser.

Can you share the code snippets that is causing the issue

fanismahmalat commented 5 days ago

I tried removing realm and @realm/react and the app does not freeze. Seems that there's a performance implication? Is it known? @kneth

On my side, there was no performance implications when I destructured the useUser.

Can you share the code snippets that is causing the issue

It seems that the issue is not related to the destructuring of useUser. It's a general performance issue that I don't know exactly where it occurs but for me, it freezes the app. Is there any known performance issue when combining Realm with other packages, tools, envs etc?

kneth commented 4 days ago

@fanismahmalat

As @feyton suggests, please share a code snippet which can reproduce the issue

fanismahmalat commented 4 days ago

@kneth I don't know where the issue is and which file should I share... Anything specific?

kneth commented 3 days ago

You might find some valuable information by profiling your app