Many to many relations generates additional irrelevant requests

Hi team,

Working again on improving the performances of Forest admin, I have noticed useless additional requests that have a great impact, when managing many to many relations.

Here is my many to many relations:

db.devices.belongsToMany(db.t_users,
  {
    as: 'users',
    through: db.vusers_to_devices,
    foreignKey: 'device_id',
    otherKey: 'user_id',
  });
db.users.belongsToMany(db.devices,
  {
    // as:'devices',
    through: db.vusers_to_devices,
    foreignKey: 'user_id',
    otherKey: 'device_id',
  });

The navigation in Forestadmin:

  • display users list
  • access one user => displays the Summary view (beginning of the video below)
  • the Devices association appears in related data section
  • Click on Devices displays the devices associated to the user.
    => No problem
  • click on one Device entry
    => Problem: Forest admin is generating requests to access the users (the parent relation).

Please have a look at this video

Displaying the details of one device entry should not generate the requests to display the list of the parent users.

Please note that this problem does not occur when navigating directly from the devices collection as the initial list.

My current setup:

    "database_type": "postgres",
    "liana": "forest-express-sequelize",
    "liana_version": "6.6.0",
    "engine": "nodejs",
    "engine_version": "12.13.1",
    "orm_version": "5.22.3"

Hi @Louis-Marie,

Thanks for this interesting feedback!
This would definitively enhance performance and reduce latencies, especially when data is long to load.
I am creating a product board ticket in order to ask for an investigation about these useless requests.
Using many-to-many relationship (or any other!), we should not load twice records.

Best,

Hi @Sliman_Medini

Thank you for this update.

But, from our point of view, this is not only a feature request, this should be considered as an issue please.
When a person is working 8 hours a day on Forest admin, it is very important to be efficient, and 2 or 3 seconds that could be earned on a screen impact the whole performance when it is repeated many many times per day.

Kind regards

Hello @Louis-Marie !

Technically the platform is working as designed so we can’t really create an issue for your problem, but be assured that our product team looks closely to each and every one of your requests!

Improving the performance of our platform is an ongoing topic, so we surely take all the suggestions we can.

In the meantime, I wish you a happy new year in advance :slightly_smiling_face:

1 Like