-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Goals
Try to create an API key for the logged-in user and pass it between the RN client and Node server.
Expected Results
- user.apiKeys.fetchAll() should return the list of existing keys
- user.apiKeys.create("api-key-1") should return an object with valid _id field.
Actual Results
- user.apiKeys.fetchAll() crashed
- _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