New layout refresh problem

Hi @Louis-Marie,

The elements you shared in private allowed to see more in details what happened.
The problem does not come from your layout, it is located in the smart action load hook mechanism.

We were not able to reproduce locally.

At some point your server sends the smart action fields with the missing enum.

Can I ask you to put console.log(fields) in your load function?
This would allow us to check if the enum value were drop before or after the function call.

Regards

Hi @Sliman_Medini

ok, thank you for your suggestion.
We are progressing…

I started adding the console.log(fields) to my load function in my vusers collection, and nothing was logged, so I didn’t understand what was wrong.

After that, I remembered that I have exactly the same smart action name in another collection named vusers_monitorings, which points to the same endpoint.

Let’s see:

Liana.collection('users', {
  actions: [
    ...
    { name: 'Mail request user action',
      type: 'bulk',
      endpoint: 'forest/actions/mails/request_user_action',
      fields: [{
        field: 'Mail_template',
        ...
       }],
      hooks: {
        load: ({ fields /* , request */ }) => {
          console.log('******** users ***************');
          console.log(fields);
          ...
        },
      },
    },
    ...
    },
  ],
});

and for the other collection:

Liana.collection('vuser_monitorings', {
  actions: [
    ...
    { name: 'Mail request user action',
      type: 'bulk',
      endpoint: 'forest/actions/mails/request_user_action',
      fields: [{
        field: 'Mail_template',
        ...
       }],
      hooks: {
        load: ({ fields /* , request */ }) => {
          console.log('******** vuser_monitorings ***************');
          console.log(fields);
          ...
        },
      },
    },
    ...
    },
  ],
});

And the result:

  • in Development environment, the log of users is displayed correctly.
  • in Staging environment, the log of vuser_monitorings is displayed when I am activating the action in users collection.

That is the source of the problem.
==> the wrong load hook is called when two smart actions have the same name in two different collections.
It explains my issue, because my Dummy item was added in the users collection only.

Could you please try this scenario and let me know if you are able to reproduce this issue?
Reminder: for me, it happens only in Staging, and Production (not in Development).

Thanks in advance.

Hi @Louis-Marie,

Yes we are progressing :slight_smile:

We reproduced the issue “2 smart actions with same name”.
As a workaround for now, you can make your smart action names unique.

A bug ticket was created, you can follow the resolution here.

EDIT: Having different names for smart actions is not enough. Endpoint must be also different.

Regards