Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some tables display their data as 'undefined' #122

Closed
fkranenburg opened this issue Jan 10, 2023 · 5 comments
Closed

Some tables display their data as 'undefined' #122

fkranenburg opened this issue Jan 10, 2023 · 5 comments

Comments

@fkranenburg
Copy link

Some tables are not displaying their data. I have tables that are working fine but some tables do not. All data is displayed as 'undefined'. Is this a bug?

image

@gagik
Copy link
Contributor

gagik commented Jan 12, 2023

Hey! Thank you for the report!

  • Would it be possible for you to share the schema of the table(s) that show undefined fields?
  • Do these objects have embedded objects, reference themselves and/or reference objects that reference themselves (i.e. have circular references)?
  • Could you also share what version of Realm you are using on the device?

Those might be factors why this could happen. We are currently working on a major revamp of how communication is done between the plugin and the device in #123 which should hopefully address most of this.

@fkranenburg
Copy link
Author

Would it be possible for you to share the schema of the table(s) that show undefined fields?

Yes, this is the current schema.

export const ClientAppointment = {
  name: "ClientAppointment",
  primaryKey: "id",
  isCommon: false,
  properties: {
    client: {
      type: "Client",
      indexed: false,
      optional: true
    },
    start: {
      type: "date",
      indexed: false,
      optional: true
    },
    end: {
      type: "date",
      indexed: false,
      optional: true
    },
    cancelled: {
      type: "bool",
      indexed: false,
      optional: true
    },
    professional: {
      type: "Person",
      indexed: false,
      optional: true
    },
    subject: {
      type: "string",
      indexed: false,
      optional: true
    },
    oneTimeChange: {
      type: "bool",
      indexed: false,
      optional: true
    },
    description: {
      type: "string",
      indexed: false,
      optional: true
    },
    executiveTeam: {
      type: "Team",
      indexed: false,
      optional: true
    },
    clientActions: {
      type: "list",
      objectType: "ClientAction",
      indexed: false
    },
    clientAppointmentKind: {
      type: "ClientAppointmentKind",
      indexed: false,
      optional: true
    },
    prestatie: {
      type: "Prestatie",
      indexed: false,
      optional: true
    },
    productKind: {
      type: "Constant",
      indexed: false,
      optional: true
    },
    kilometers: {
      type: "double",
      indexed: false,
      optional: true
    },
    transporttype: {
      type: "string",
      indexed: false,
      optional: true
    },
    reasonCancellation: {
      type: "Constant",
      indexed: false,
      optional: true
    },
    descriptionCancellation: {
      type: "string",
      indexed: false,
      optional: true
    },
    alternativeAddress: {
      type: "string",
      indexed: false,
      optional: true
    },
    budgetTeam: {
      type: "Team",
      indexed: false,
      optional: true
    },
    clientAppointmentArray: {
      type: "ClientAppointmentArray",
      indexed: false,
      optional: true
    },
    changeConditions: {
      type: "string[]",
      indexed: false,
      optional: true
    },
    planUnit: {
      type: "PlanUnit",
      indexed: false,
      optional: true
    },
    location: {
      type: "Location",
      indexed: false,
      optional: true
    },
    id: {
      type: "string",
      indexed: false,
      optional: false
    }
  }
};

Do these objects have embedded objects, reference themselves and/or reference objects that reference themselves (i.e. have circular references)?

Yes, it could be we have circular references (but I do not know for sure). No embedded objects.

Could you also share what version of Realm you are using on the device?

Version 11.3.1 of realm and version 1.0.28 of realm-flipper-plugin-device.

@gagik
Copy link
Contributor

gagik commented Jan 12, 2023

Thanks for the info! I was able to recreate this by adding a circular reference to a Realm object. Seems like this is related to the current workaround in #96. With the upcoming plugin and device library update (which will be based off of #123) references will be lazy-loaded so the plugin will be able to deal with circular references and avoid this behavior.

@gagik
Copy link
Contributor

gagik commented Jan 18, 2023

Hello again! The realm-flipper-plugin and realm-flipper-plugin-device have both been updated to version v1.1.0 which should address this issue. Try upgrading both and see if all data seems correct.

@fkranenburg
Copy link
Author

Just upgraded (and had to remove the realm flipper plugin manually from Flipper so it picked up the newer version automatically) and it works now. Great work! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants