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

user.apiKeys.fetchAll() crashed

      Goals

      Try to create an API key for the logged-in user and pass it between the RN client and Node server.

      Expected Results

      1. user.apiKeys.fetchAll() should return the list of existing keys
      2. user.apiKeys.create("api-key-1") should return an object with valid _id field.

      Actual Results

      1. user.apiKeys.fetchAll() crashed
      2. _id field is undefined for the object returned from create() call

      Code Sample

      import Realm from "realm";
      
      const app = Realm.App({ id: "test-abcde" });
      const credentials = Realm.Credentials.emailPassword(
        "test@test.com",
        "somepassword"
      );
      const user = await app.logIn(credentials);
      
      const key = await user.apiKeys.create("api-key-1");
      console.log(key._id); // undefined; key.key, key.name, and key.disabled all return valid values
      
      const apiKeys = await user.apiKeys.fetchAll();
      console.log(apiKeys.length); // never gets here
      

      Version of Realm and Tooling

      • Realm JS SDK Version: 10.0.0-beta.9
      • Node or React Native: reproduced on both
      • Client OS & Version: node version - 12.18.3
      • Which debugger for React Native: ?/None

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: