[5.0.0] Android returns Results with length 1 but no keys or values

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

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      Goals

      I am trying to fetch some objects from database.

      Expected Results

      Getting 1 object with all properties.

      Actual Results

      I get Results of length 1 but when getting the object via index 0, it returns no properties.

      Steps to Reproduce

      Run the code on Android

      Code Sample

      const results = realm
              .objects<ImporterAuthenticationModel>(ImporterAuthenticationModel.schema.name)
              .filtered('importerId = $0', importer.importer.id);
      
            if (results) {
              console.log(results.length);
              console.log(results[0].id);
            }
      

      Output is:

      1
      undefined
      

      Schema:

      export class ImporterAuthenticationModel extends BaseModel {
        public static schema = {
          ...BaseModel.schema,
          name: 'ImporterAuthenticationModel',
          primaryKey: 'uniqueId',
          properties: {
            ...BaseModel.schema.properties,
            uniqueId: 'string',
            id: 'string',
            title: 'string',
            subTitle: 'string?',
            imageUrl: 'string?',
            importerId: 'string',
            additionalDataString: 'string?',
            rawStatus: { type: 'int', default: ImporterAuthenticationStatus.AUTHENTICATED },
            expiresAt: 'int'
          }
        };
      

      Version of Realm and Tooling

      • Realm JS SDK Version: 5.0.0
      • Node or React Native: React Native
      • Client OS & Version: Android 9PKQ1.181121.001 (Mi 9 Lite)
      • Which debugger for React Native: React Native Debugger (but it also fails if using production build from FireBase)

            Assignee:
            Lubo Blagoev
            Reporter:
            Unito Sync Bot
            Archiver:
            Marc Greenfield

              Created:
              Updated:
              Resolved:
              Archived: