Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-78

addListener notification is empty (documentation only)

      When using addListener(objects, changes) on React Native iOS it always returns empty on the first notification and the second notification returns what should have been in the first one.

      I found in results-tests.js below that first notification is empty.

      Is this by design or am I doing something wrong here?

              realm.objects('TestObject').addListener((testObjects, changes) => {
                  // TODO: First notification is empty, so perform these
                  // assertions on the second call. However, there is a race condition
                  // in React Native, so find a way to do this in a robust way.
                  //TestCase.assertEqual(testObjects.length, 4);
                  //TestCase.assertEqual(changes.insertions.length, 1);
                  resolve();
              });
      

            Assignee:
            ferdinando.papale@mongodb.com Ferdinando Papale
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: