Regression issue : smart field references not populated

Hi team,

After testing forest-express-sequelize 6.6.2, there is a new regression issue.

It seems that the smart fields used as references of related associations are no more populated when accessing the summary view.

It was working well in forest-express-sequelize 6.6.0 (not tested in 6.6.1).

Here is a video that is illustrating the problem:

You will notice how the kyc and card (whose references are defined as smart fields) are not displayed in the summary view, if they are not already displayed in the list used to access the data.

Please feel free to ask if you need any more information.

Best regards

My setup:

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

Hi @Louis-Marie,

Thanks for your message and for sharing your issue.
We are currently trying to reproduce it.
I’ll come back to you as soon as possible.

Thanks for your patience :pray:

Hello @Louis-Marie :wave:
Thank you for your feedback :grinning_face_with_smiling_eyes:

I have not been able to reproduce your issue.
By looking at your smart fields, I assume it is following this previous topic, right?
Can you confirm me you are using afterFind hook for creating your smart fields card and kyc?
As I can see, it seems to work well with the subscription field. Is it a smart field? How is it declared?

Would that be possible for you to share with us your models, routes if overidden, and smart field declaration?
It will help us getting as closer as possible of your configuration.

Furthermore, just to be sure and clarify a point when you are saying "kyc and card are not displayed in the summary view", you mean you can see the id with a link but not the value with a link?

Let me know :smiley:

1 Like

Hi @Guillaume_Cisco,

Sorry for my late answer.

In order to reproduce the issue, please be sure to reload your page after hiding the column in the list, because otherwise, it is in cache somewhere, and the summary view is then displaying it without any issue.

Here is additional information.

Furthermore, just to be sure and clarify a point when you are saying " kyc and card are not displayed in the summary view", you mean you can see the id with a link but not the value with a link?

Yes, that’s it. The ID are displayed (as illustrated in the video) instead of the references.

By looking at your smart fields, I assume it is following this previous topic, right?

Yes, but only for other smart fields. The smart fields used as references in Forest collections are defined using the standard get() method (see an example below).

Can you confirm me you are using afterFind hook for creating your smart fields card and kyc ?

For some of them only. Not for those used as references.

As I can see, it seems to work well with the subscription field. Is it a smart field? How is it declared?

It works with subscription only because I kept this field displayed in the list before accessing the summary view.
When hiding the subscription field in the list, and reloading Forest, then I have the same problem on it.

Would that be possible for you to share with us your models, routes if overridden, and smart field declaration?
It will help us getting as closer as possible of your configuration.

Sure.
The GET /users route was overridden before my tests, but I commented it before the video to be sure that it was not due to my custom code.
For information: users → cards / users → kyc / users → subscriptions are all defined in the same way for my native relationships:

db.users.hasOne(db.cards);
db.users.hasOne(db.subscriptions);
db.users.hasOne(db.kyc);

All the 3 smart fields used as the reference field in Forest admin in their related collections are defined using the same get() method.
So, I will illustrate the subscriptions collection smart field only.

    field: 'Subscription',
    type: 'String',
    get: (subscript) => {
      if (subscript.updated_at && subscript.premium && subscript.monthly) {
        return 'Premium monthly';
      } else if (subscript.updated_at && subscript.premium) {
        return 'Premium yearly';
      } else if (subscript.updated_at) {
        return 'Free';
      } else {
        return 'Not yet chosen';
      }
    },

Hoping this will help.

Best regards

Hi @Louis-Marie,

First thanks for detailing that much your issue it really help us to investigate.
I did reproduce your issue I’ll create an issue for this :wink: . You’ll be able to track its status below:

Hello @Louis-Marie

The 6.6.3 version has been released! :tada:
Tell me if everything is ok now :smiley:

1 Like

Hi @Guillaume_Cisco

It has been tested successfully, and is in production now.

Thanks for this update and for your work.

1 Like