getSyncSession cannot resolve session even though it exsist

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      How frequently does the bug occur?

      Always

      Description

      I have this piece of code

      console.log('getCurrentPartitionValue()', getCurrentPartitionValue());
      syncSession = Realm.App.Sync.getSyncSession(
        realmApp().currentUser,
        getCurrentPartitionValue(),
      );
      console.log('syncSession', syncSession);
      
      const sessions = Realm.App.Sync.getAllSyncSessions(
        realmApp().currentUser,
      );
      console.log('sessions', sessions);
      syncSession = sessions.find(session => {
        return session.config.partitionValue === getCurrentPartitionValue();
      });
      console.log('syncSession', syncSession);
      

      the output is this

       LOG  getCurrentPartitionValue() 655d5e27fce9035abdbe2654
       LOG  syncSession null
       LOG  sessions [{}]
       LOG  syncSession {}
       LOG  syncSession {"partitionValue": "655d5e27fce9035abdbe2654", "user": {}}
      

      As you can see, the same partition value and user, used in getSyncSession yield null, yet if I resolve it via getAllSyncSessions, it is exsist

      Stacktrace & log output

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      getCurrentPartitionValue() 655d5e27fce9035abdbe2654
      syncSession null
      sessions [{}]
      syncSession {}
      syncSession {"partitionValue": "655d5e27fce9035abdbe2654", "user": {}}
      

      Can you reproduce the bug?

      Always

      Reproduction Steps

      Realm.App.Sync.getSyncSession

      Version

      ^11.10.2

      What services are you using?

      Both Atlas Device Sync and Atlas App Services

      Are you using encryption?

      Yes

      Platform OS and version(s)

      WSL2 on Windows 11

      Build environment

      Which debugger for React Native: ..

      Cocoapods version

      -

            Assignee:
            Unassigned
            Reporter:
            Unito Sync Bot
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: