Collections and Smart Relationships not showing up after migrating to v8 and new development workflow

:warning:This is a template you must use to report issues. :warning:

I migrated my project from v7 to v8. I added a new Collection and a hasMany Smart Relationship from an existing collection to the new one, like follow:

collection("ExistingCollection", {
    fields: [{
	field: "hasMany_NewCollection_targetField",
	type: ["String"],
	reference: "NewCollection._id"
  }]
})

and the relationship was not showing up in the Layout Editor. Existing smart relationships are displayed, and the endpoint responsible of the new relationship is returning data, which I found confusing.

So I thought it was related to the new development workflow, as it seemed to me it was only a UI issue. Thus I migrated my project, installed the forest-cli, ran an init to setup the development environment. When I started the project, my existing collection was gone, along with few others (I believe they all have a hasMany relationship like the one I was trying to add).

Now I’m stuck, fortunately this is only on the Development environment, and does not impact (at least for now) my Production environment.

Feature(s) impacted

Please describe in this mandatory section the feature(s) that will be discussed in this topic.

  • Smart Relationships
  • Layout Editor

Observed behavior

Please describe in this mandatory section the current behavior you observe.

Collections containing hasMany Smart Relationships are hidden.

Expected behavior

Please describe in this mandatory section the behavior you are expecting.

Collections and Smart Relationships must be shown.

Context

Please provide in this mandatory section, the relevant information about your configuration:

  • Project name: Pinpo Admin
  • Team name: Operations
  • Environment name: DEVELOPMENT
  • Agent type & version: “forest-express-mongoose”: “8.6.7”
  • Recent changes made on your end if any: Migrated to v8 and project to new development workflow.

Hey @fbeiger, and welcome to our community :wave:

Could you share (Here or as DM) the real collection name that disappear (So I could check on my end if I’m able to spot the reason)?

Also, I can see that you did not create a branch on your development environment.
I’m pretty sure that’s not the issue here, but could be worth trying.

Could you also check if that collection & the associated relationship are correctly set in your .forestadmin-schema.json? (I can see on my end that you development environment & your production do not share the same schema, which is a good new if you introduced a new field/collection)

Thanks in advance :pray:

1 Like

Hi @fbeiger :wave: Can you confirm the issue happen only on smart relationship ?

Hi @Arnaud_Moncel

As I mentioned, 2 Collections disappeared as well. I suspect it is because they have a similar hasMany Smart Relationship, but I don’t really know for sure.

Something I just figured out, I migrated my project to the new development tools without asking the support, it may have an impact.

I see a thing on our end, The Agency model seem to be empty on your rendering.
But it seem well configured on your .forestadmin-schema.json.
I didn’t see any errors on our side, so it is pretty strange.
I suggest you to create a new development environment and try again to see if the issue persist or not.

In order to understand what happen, how do you create this environment ?

let me know :pray:

Hey @Arnaud_Moncel,

I already deleted and recreated the development environment, and the issue was still persisting.

I just followed the steps given in Development workflow - Developer guide :

  • I installed forest-cli
  • Ran forest init and pretty much press ‘Y’ for every question asked
  • Ran yarn start to start the project

Hi @fbeiger after long research, the issue probably come from the definition of two smart action.

One based on Agency model with Exporter les leads name and on the field Tags (au moins un des tags sélectionnés).

And another based on AgencyFeature model with Exporter les leads name and on the field Tags (au moins un des tags sélectionnés).

All these fields are ['Enum'] type and the enums option does not allow null value.
Can you remove this options and restart your server please? And let me know if it fix your issue? :pray:

Hey @Arnaud_Moncel, it seems to have done the trick! Thanks a lot.

Indeed the field Tags (au moins un des tags sélectionnés) was was based on another object and a variable was missing.

Thanks again for your responsiveness!

Happy to hear that! Don’t hesitate if you have more questions.

1 Like

Hi @Arnaud_Moncel,

I have another issue that may be related. After fixing my schema, I did some changes again then uploaded a new schema using my CI. On the other hand I did some changes in my layout (in the my Development environment, on the “leads” branch) and when I tried to forest deploy my changes I had the following message: × Source and destination environments must have the same schema. Please check your environments code is synchronized..

I went to see the Layout on my Production env, and there is a missing Smart Relationship on the Agency collection: hasMany_Lead_originAgency.

Everything works fine on my Development env though.

Hi @fbeiger :wave: please open a new thread to talk about your new issue. :pray: