All smart fields are processed during a GET list even those that are not in the param

Hello,

I have some smart-field which make time to be process. So I put it only on the details of my collection, but they are still processed when I get my list back?

My fiels are not in the params request :

But i saw them in the response :thinking:

If it’s not a bug, why the backend not only process the smart-field specified in params and return only them to optimize the app ?

Hi, @Justin_Martin,

What is your project name and agent version, please?

Regards

click-and-care-backoffice
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36

1 Like

Thank you
Sorry by saying ‘agent’ I was thinking your forest-express-xxx library version

it’s forest-express-sequelize

Ok, you are in version 8.4.7
Can you please try with last, 8.5.7?

Regards

It’s the same with the last version

Ok, thank you.
We are going to reproduce and fix this issue.

Regards

Hello @Justin_Martin,
I am trying to reproduce this issue but it does not work.

  1. I have created a smart field on a collection.
  2. I can see it on the list view.
  3. If I remove the smart field from the request parameter, the agent does not return this smart field as expected. There is no bug.

Am I reproducing your scenario correctly?

My agent version is forest-express-sequelize: 8.5.7 and I have also tested in 8.4.7.

Can you try with this scenario :

  1. I have created a smart field on a collection. (with in get => console.log('build'))
  2. I hide it on the liste view
  3. I refresh the data
  4. I see in backend console: build

Same behavior. Very weird. :frowning:
How do you hide your smart field in the list view ?
Can you provide your smarfield declaration/definition and your HTTP request without the smart field please ?

Hide it with the edit layout
Capture d’écran 2022-05-27 à 18.43.36

Hello,
This morning I have retry exactly the same scenario that you give and it does not work again. We have tested in two different computers.
Please can you provide your HTTP request from your console when you load the list please ? (copy/past the request). Also, what is a name of your smart field ? Maybe the frontend has a problem …

HAR file containing all log of request: WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free (to big to be send using form “upload file”)

tool to open:
https://toolbox.googleapps.com/apps/har_analyzer/?lang=fr

You can provide it as fetch method :slight_smile:

-REMOVED- I have save it. There are some personal data that why it was removed.

Please, give me the name of your Smart field :slight_smile: ? thanks

it’s paymentInfoIban, paymentInfoBic, paymentInfoAddressCity, paymentInfoOwnerName, paymentInfoAddressAddress

Hello,
Do you have some smart field that are not hidden ? If yes, can your try to hide them and tell me if you have always the issue. thanks :slight_smile:

I hide all my field, and keep only my id field

Request :

fetch("https://admin.clickandcare.fr/forest/beneficiary?timezone=Europe%2FParis&fields%5Bbeneficiary%5D=id&page%5Bnumber%5D=1&page%5Bsize%5D=15&sort=-createdAt", {
  "headers": {
    "accept": "application/json",
    "accept-language": "en-US,en;q=0.9,fr-FR;q=0.8,fr;q=0.7",
    "authorization": "*****",
    "cache-control": "no-cache",
    "content-type": "application/json",
    "forest-context-url": "https://app.forestadmin.com/click-and-care-backoffice/Production/ClicknCare/data/beneficiary/index",
    "pragma": "no-cache",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "cross-site",
    "sec-gpc": "1"
  },
  "referrer": "https://app.forestadmin.com/",
  "referrerPolicy": "origin",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "include"
});

Response :

{
    "data": [
        {
            "type": "beneficiary",
            "id": "b8cb9943-d290-458b-b1c9-a6ee8735d153",
            "attributes": {
                "merged updatedAt": 1640170028000,
                "personAddressRegion": "Île-de-France",
                "personGender": "man",
                "personFirstName": "Benjamin",
                "personLastName": "Cohen",
                "personNumberSocialSecurity": "",
                "personPhone": "********",
                "personAddressPostCode": "75018",
                "personAddressCity": "Paris",
                "personAddressAddress": "********",
                "person.year": "",
                "personNationalities": [
                    "France"
                ],
                "personCountryOfResidence": "France",
                "personLanguages": [
                    "Français"
                ],
                "announceContractType": "cdi",
                "announcePublishedAt": "2022-02-11",
                "announceStartDate": "2022-02-20T00:00:00.000Z",
                "announceServices": [
                    "bed-time",
                    "washing-dressing"
                ],
                "announceHourSalary": 1000,
                "announceCareGiverGenderWanted": [
                    "man",
                    "woman"
                ],
                "announceCareGiverLanguageWanted": "Français",
                "announceLeadBackofficeAdminFullName": "Naomi Cohen",
                "familyBackofficeAdminFullName": "",
                "familyPurposeOfCall": "follow-up",
                "familyPaymentInfoMangopayId": "********",
                "familyRelationType": "Frere",
                "familyPersonFirstName": "Noémie",
                "familyPersonLastName": "Parker",
                "familyPersonAddressRegion": "Pays de la Loire",
                "familyPersonAddressPostCode": "44300",
                "familyPersonAddressCity": "Nantes",
                "familyPersonPhone": "********",
                "familyPersonEmail": "********@gmail.com",
                "familyPersonBirthDay": "1969-02-01",
                "familyPersonCountryOfResidence": "France",
                "familyPersonNationalities": [
                    "France"
                ],
                "familyPersonLanguages": [
                    "Français"
                ],
                "paymentInfoIban": "********",
                "paymentInfoBic": "********",
                "paymentInfoOwnerName": "Benjamin Cohen",
                "paymentInfoAddressAddress": "********,
                "paymentInfoAddressCity": "Paris",
                "paymentInfoAddressPostCode": "75018",
                "announce-hourVolume": 2,
                "potential-fees": "19.20€",
                "smartStatus": "partial-search",
                "id": "b8cb9943-d290-458b-b1c9-a6ee8735d153",
                "createdAt": "2022-02-11T12:09:27.706Z",
                "updatedAt": "2022-02-11T12:09:27.736Z",
                "pathology": [],
                "diet": [],
                "pets": [],
                "onSiteEquipment": [],
                "endReason": null,
                "cesuAffiliationNumber": null,
                "financialAidNbHours": 0,
                "financialAidAmount": 0,
                "financialAids": [],
                "wayToAccess": [],
                "girScore": null,
                "beneficiaryReference": 57
            },
            "relationships": {
                "hourDeclaration": {
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/hourDeclaration"
                        }
                    }
                },
                "MissionEnCours": {
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/MissionEnCours"
                        }
                    }
                },
                "MissionTerminees": {
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/MissionTerminees"
                        }
                    }
                },
                "IntervenantEnCours": {
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/IntervenantEnCours"
                        }
                    }
                },
                "PlanningGlobal": {
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/PlanningGlobal"
                        }
                    }
                },
                "person": {
                    "data": {
                        "type": "person",
                        "id": "4ead48b2-0a05-49b1-9f0a-95ce72077125"
                    },
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/person"
                        }
                    }
                },
                "family": {
                    "data": {
                        "type": "family",
                        "id": "f883aeaf-1f1e-4f65-b464-24b52a22e6ff"
                    },
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/family"
                        }
                    }
                },
                "announce": {
                    "data": {
                        "type": "announce",
                        "id": "ad1e9c4c-1785-4f79-ba59-67ad901f13e8"
                    },
                    "links": {
                        "related": {
                            "href": "/forest/beneficiary/b8cb9943-d290-458b-b1c9-a6ee8735d153/relationships/announce"
                        }
                    }
                }
            }
        },
    ]
}

I still have the completed smart-field in response. But if you have already made sure to load only the smart-fields that are in the query parameters it is ok. I have modified some part of forest-express-sequelize maybe it’s the cause.

Anyway I changed the basis of my problem, instead of loading data from an external service I also save it in the database so I no longer have performance problems.

(All data are test data, iban, bic are not valid :smiley:)