Error displaying hasMany relationship field

Feature(s) impacted

Cannot show hasMany relationship field.

Observed behavior

We have a sender model and an account_sender model. The latter belongs to sender (one-to-many relationship). When I visit the account_sender field in sender record Details tab and there’s no account_sender under it, it works correctly. But when there are account_senders belonging to the sender, I got following error in console:

Error: Expected id to be a string or number, received null

and the UI is like:

account_sender has no id column in the table.

Expected behavior

No error. Show a list of account_senders.

Context

  • Project name: MTMO Admin
  • Team name: Operations
  • Environment name: new-QA

Hello @Chloe,

Thanks for reaching out :raised_hands:

Was it working before?
Could you please send us the sender and the sender_account model definitions please?

Thanks.

Never since the sender_account model added.

Table sender:
id | uuid |

Table account_sender:
account_id | text |
sender_id | uuid |

Hi @Chloe,

Thanks for your answer.

Could you please share you entire JS model definition of sender and account_sender please (especially the relationship parts)?

I’m seeing that you have a account_id field in your account_sender, is there an account table too?

Moreover, could you check if the id of the sender is never null and same for the sender_id of the account_sender table?

Moreover, if you’re trying it in your development environment, you’ll be able to see the request that is made and that is causing this issue. We might learn a bit more from it.

Thanks.

Hi @adriguy, I might know why while looking into the request that you asked for.
We are using composite primary key in account_sender model, and seems it’s not yet supported: Composite primary key.

Hey @Chloe,

Thanks a lot for having had a closer look!

You’re right, composite keys are not well supported yet… Sorry for the inconvenience. I’m pushing your feedback to our Product roadmap.

On a side note: we have released a brand-new agent-nodejs (complete rework of the agent you are working on, more flexible, easier to use, etc.) and this agent supports composite keys.
We don’t have a clear documentation to migrate from the former agent to the new one yet. But if you want to give it a try soon, be sure we’ll be available to help you out.

Let me know!
Cheers.

Thanks for the side note @adriguy!

Just wonder what else does this new agent support while the old one doesn’t. To see if it’s worth to ask the team to put effort into agent migration soon.

1 Like

@Chloe someone from our Customer Success team will reach out to you to explain all this.
Thanks!

1 Like