New layout refresh problem

Hi team,

I have once again a layout refresh issue.
It is very similar to the issue I encountered here

I updated a list of items in a smart action named: Mail request user action

The new item Remin****ths appears in Development:
image

However, after migrating towards the Staging environment,
=> the new item does not appear
Then, in the Production environment,
=> Same issue, the new item does not appear

Team: Compliance
Project: MyPocket

In my previous ticket, I had to wait for other internal changes to come and integrate them to make the new item appear.
So, the original issue has not been solved and was reproduced today.
Could you please investigate?

Thanks in advance

My Setup:

    "liana": "forest-express-sequelize",
    "liana_version": "8.2.2",
    "stack": {
      "database_type": "postgres",
      "engine": "nodejs",
      "engine_version": "14.16.0",
      "orm_version": "5.22.3"
    }

Hi @Louis-Marie :wave:, i’m afraid i see it on our end.
I see the Remin****ths in the enums array from Mail_template field.
The smart action have a load hook is that right? Does the load hook return the right enum?

Hi @Arnaud_Moncel

I’m sorry I could not wait and I integrated other changes.
Then, the new item appeared.

I am now available to make new tests in my Development and Staging environments if you have some time to monitor this issue.

As an example, I will add a new Dummy item in the same list.
Please just let me know if you are ready to monitor at the same time.

Thanks for your help.

If I understand well all is back to normal now?

In order to find what happen can you give me approximatively the hour on which you deploy to staging the first time(where the new enum item is not available) and the second time who fix your issue :pray:

Yes, all is back to normal now.

Ok, let’s take the Staging environment:

  • Around: Oct 5, 2021 3:02pm GMT+0200 : First change was made
    – new item was added, and server restarted
    – it was visible in .forestadmin.schema.json file but not in the UI
    – I waited some time and refreshed the UI
    – the new item was still not visible in the UI

  • then, I made different tries in Staging:
    – manually editing the .forestadmin.schema.json, back and forth
    => no change in the UI
    – switching from enum to string
    => changed in the UI
    – switching back to the enum, including the new item
    => changed in the UI with a list, but still with the new item missing

  • Around Oct 5, 2021 4:50pm GMT+0200 : New change in Development
    – Indeed, I added the exact new item in another identical list in another smart action.
    => no issue: Changes appear in the UI
    – pushed to Staging

  • Around Oct 5, 2021 4:55pm GMT+0200 :
    – New change pulled in Staging
    – Server restarted
    ==> Changes appear in the UI in Staging

Hoping this will help.

Hi @Louis-Marie,

Thank you for the feedback.

I was not able to reproduce the issue. Either I am missing it, or maybe we have a subtlety in the way schemas have to be handled.

You maybe already know this, but please note the following informations:

  • Only development environments re-generate the forestadmin-schema.json
  • Consequently, changing code without changing the related forestadmin-schema.json has no effect on environments other than development ones.
  • Others environments than development should not be touched directly. They should just be git pulled.
  • forestadmin-schema.json must be versionned so the changes on dev is propagated on merge.

The normal flow is the following:

  • Change something on the dev server (inside models or forest folder)
  • Start or restart the dev server
    • it will refresh the forestadmin-schema.json
    • it will then send it to forest to perform the schema update.
  • When it’s ok, merge the dev branch on the staging branch
  • Pull & restart the Staging
    • new code and forestadmin-schema.json is here
    • it will then send it to forest to perform the schema update.

When Forest performs a schema update, it makes an hash matching the whole content of forestadmin-schema.json. When the hash is new, we perform a schema update. If the hash is the same, we “do-nothing”. At the date of yesterday, your project started 2 schema update (15:21 and 16:44, one time for staging and one for dev.) Both schema update updates correctly the schema. There was no “do-nothing” call.

When following this flow, I am not able to reproduce any issue.

If you still encounter the problem, please do not hesitate to restart your staging many times (like that whe can easier identify it in our logs) and to keep the datetime to inform us.

Regards,

Hi @Sliman_Medini

I know well this flow, and this is our usual way of working.

I made a new change this morning to reproduce the issue, and I can say that the bug is still present:

Project: MyPocket
Team: Compliance
Collection: Users
Smart action: Mail request user action
Field: Mail_template

  • Wed Oct 6 12:27: Development environment
    – I added a new Dummy item to test layout refresh item in the enum list of the Mail_template field of the smart action
    – I starting my Development server with the change in place
    – the .forestadmin-schema.json file has been regenerated
    ==> the layout is well refreshed, the new item appears in Development environment

  • Wed Oct 6 12:34 : Staging environment
    – change was merged in the staging branch
    ==> the programme code and .forestadmin-schema.json file are well updated
    – Staging server was restarted
    – I got the warning in my browser stating that the layout has been changed
    ==> that confirms that the new hash was generated and sent.
    ==> Could you please confirm that you received the new hash?
    – 12:36 : I reloaded the Staging layout in the browser
    ==> Issue reproduced: the dummy item does not appear
    – 12:38 : I reloaded the Staging layout in the browser
    ==> Issue reproduced: the dummy item does not appear
    – 12:40 : I reloaded once again the Staging layout in the browser
    ==> Same issue reproduced: the dummy item still does not appear
    – 12:42 : I restarted the Staging server, without making any change
    => this time, I got no warning in my browser about a layout change, and this is normal since I did not change anything.
    – 12:44 : I reloaded once again my Staging layout in the browser
    ==> Still the same issue reproduced: the dummy item still does not appear

Please let me know if I can do anything to help diagnose the issue.

Best regards

Hi @Louis-Marie,

Ok, I understand better now.
So we have a synchronize process that:

  • produce the browser notification
  • save the new schema on our side (I saw it, 06/10/2021 12:34:16)
  • but does not add an enum value when it should.

I am able to see “Dummy item to test layout refresh” as an enum value for the layout of the environment Staging and for the team “Tests only”.

The last synchronisation was at 06/10/2021 12:34:16
Can you confirm the value is still not here now? If this is the case, we have an issue about layout loading in the browser, and not a problem with synchronization.

Regards

Hi @Sliman_Medini

Yes, I confirm that the new item “Dummy item to test layout refresh” is still not visible in Staging, even after a browser refresh

Thanks

Ok, was it with the team “Tests only” ?

I made all the tests in the team Compliance as indicated before.

Ok, I’ve checked also the Compliance layout.
The result is the same: the value Dummy item to test layout refresh is present in the enum of Mail_template.

So we have a different problem.
The layout contains a new value but it’s not displayed.

I will try to investigate this and I will inform you.

Regards

Hi,

I’ve made a few tests and unfortunately I didn’t found something interesting.

  • The Dummy value is present in the layouts of your staging.
  • As soon as an enum value is added to the layout (Tested with a manual add), it appears in the UI.
  • As soon as an enum value is added to the forestadmin-schema.json on a Staging, it appears on the UI after refresh.

I’ve performed a layout refresh on your staging/Compliance layout, can you check if the value is here?

Regards

Hi @Sliman_Medini

Sorry, but the Dummy item is still not present in the UI.

I started the Staging server again, just in case, and unfortunately: nothing new.
==> The problem persists.

I looked at the network tab under my Browser when selecting the action, and got the answer:
=> the Dummy item is not present in the answer

Thanks

Ok,

We may have to triple check that we are looking at the same layout: We look at the layout on the environment Staging on the team Compliance, right? Can you share the URL that gives you a layout without the Dummy value? Also the content of the response may be useful for us (You can send it via a private message)

Now (last refresh 12:59) the Dummy value is found in the layout cache:
Inside the field 88710041-3715-11eb-b80c-43bf9bea8b65 named Mail_template.
This field is present in the smart action named Mail request user action.
This smart action is present on the collection Users

Here is the values of the enum:
“Sus[…]EPA”,
“Sus[…]ard”,
“Fro[…]ice”,
“Nee[…]ard”,
“Cas[…]ths”,
“Rem[…]ths”,
“Dummy item to test layout refresh”,
“Neg[…]ays”,
“Neg[…]ays”,
“Nev[…]unt”,
“Ina[…]ths”,
“Req[…]ess”

Do we aggree on the location of the problem?
Sorry for the inconvenience

Hi @Sliman_Medini

We look at the layout on the environment Staging on the team Compliance , right?

Yes, we agree on the location of the problem.
But yes, now, the item appears.
I don’t understand why it works now.
I may reproduce it once again with another dummy one?

I will send you the response of this morning in a private message.

Thanks

For information, I will be out of office in the next days, so I had to rollback my tests.

The Dummy item has been removed at 17:16 in Staging.
The UI has been updated accordingly.

Thanks

Hi Louis-Marie,

Thank you for the information.
I’ve received and analyzed the data shared in private.
I am thinking the issue is not coming from the layout but from the smart action hook. In another test, I will be interesting for us to have.

The shared infos were, if I understand well:

  • the URL that loads the layout
  • the payload answered by your server at the smart action form load or change.

In a further test, I you aggree to make it, it would be nice to share:

  • the new value added
  • the environment/team tested in the UI
  • the request/response of the layout request
  • the request/response of the smart action form request(s)
  • the smart action hook code

Interesting info: to share a request/response, it’s possible to use “save HAR content” from the right-click menu in the network tab.

Hi @Sliman_Medini

The shared infos were, if I understand well:

  • the URL that loads the layout
  • the payload answered by your server at the smart action form load or change.

That’s correct.

I am back at the office and had the time to launch new tests.

All these tests have been conducted with the same specifications:

Team: Compliance
Collection: Users
Smart action: Mail request user action

New value added: New dummy item - 14/10/2021

1. In Development environment

– 14/Oct/2021:17:07:40 +0000: Server restarted
==> The new item appears. No problem

2. In Staging environment

– Changes merged from Development

– 14/Oct/2021:17:18 +0000: Staging server restarted
– 14/Oct/2021:17:20 +0000: Users collection loaded (HAR content will be sent in a private message)
– 14/Oct/2021:17:21 +0000: Action menu activated (HAR content will also be sent)
==> The new item does NOT appear. Problem was easily reproduced.

I will be glad to send you also the smart action hook code.

Thanks in advance

Hi team,

Any news on this issue please?

Thanks in advance