Stalled validation on update record

When updating a record and there is a value missing for an obligatory field, the loader remains in the loading state indefinitely, instead of throwing a red error validation. This is for the jurata project running the new node.js agent

Browser logs

Uncaught (in promise) Error: Attempted to handle event `becameError` on <forest-lawyers-profileText:null> while in state root.loaded.saved. 
    at en._unhandledEvent (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:370938)
    at en.send (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:369238)
    at en.adapterDidInvalidate (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:373110)
    at g._fragmentCommitWasRejected (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:534791)
    at u.commitWasRejected (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:525711)
    at g.commitWasRejected (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:532808)
    at en.adapterDidInvalidate (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:373063)
    at u.recordWasInvalid (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:391971)
    at e.pushErrors (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:629915)
    at e.validate (vendor-9133945a52f16b84d40aaad52408b6bc.js:89:617054)
_unhandledEvent @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
send @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
adapterDidInvalidate @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
_fragmentCommitWasRejected @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
commitWasRejected @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
commitWasRejected @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
adapterDidInvalidate @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
recordWasInvalid @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
pushErrors @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
validate @ vendor-9133945a52f16b84d40aaad52408b6bc.js:89
saveRecordEdition @ client-09f1bc2845f5ac0c709314f220173297.js:1
applyEditChanges @ client-09f1bc2845f5ac0c709314f220173297.js:1
E @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
triggerEvent @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
trigger @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
send @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
send @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
applyChanges @ client-09f1bc2845f5ac0c709314f220173297.js:1
onClick @ client-09f1bc2845f5ac0c709314f220173297.js:1
await in onClick (async)
E @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
triggerEvent @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
trigger @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
send @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
send @ vendor-9133945a52f16b84d40aaad52408b6bc.js:58
applyChanges @ client-09f1bc2845f5ac0c709314f220173297.js:1
onClick @ client-09f1bc2845f5ac0c709314f220173297.js:1

Hey @David_Roegiers,

Thanks for reaching out :raised_hands:
Hope you’re great!

Let me check that really quick.

Cheers.

@David_Roegiers,

I’ve just tried on my side and it seems to work fine.

So let’s deep dive into your use case.
Is your validation done like this (directly in the agent configuration):
collection.addFieldValidation('max_speed', 'Present');
?

Thank you.

Hi @anon34731316

Thanks for trying it out.

The field requirement is set in the mongoose model (sorry, I could have mentioned that earlier).

profileTextSelection: { type: String, required: true, default: 'generated' },

This behaviour is new, in other words, it used to work as expected.

Hey @David_Roegiers,

Thanks for your reply!

Hum that’s strange, I’ve just tried out with the same configuration of yours, same version of agent-nodejs, no luck.
Could you please share your @forestadmin/datasource-mongoose and mongoose version please? :pray:

Are you 100% sure that the error you’re getting if due to this missing value?

Thanks.

Hi @anon34731316

Sorry for the late reply, I was taking some time off.

Are you 100% sure that the error you’re getting if due to this missing value?

Yes, it only happens if I let the dropdown value of a required field empty. If I give it a valid value, it works.

Here are the versions:

    "node_modules/@forestadmin/datasource-mongoose": {
      "version": "1.5.29",
      "resolved": "https://registry.npmjs.org/@forestadmin/datasource-mongoose/-/datasource-mongoose-1.5.29.tgz",
      "integrity": "sha512-gpW0gm2LgDngeTCuoP0fp47IUMBpELjrb2ub7wG8p5/Sd19f4F079QnRPL2+58/PrkzVZz9zPK+0PGW5kN02Kw==",
      "dependencies": {
        "@forestadmin/datasource-toolkit": "1.29.0",
        "luxon": "^3.2.1"
      },
      "peerDependencies": {
        "mongoose": "6.x || 7.x"
      }
    },
...
"node_modules/mongoose": {
      "version": "6.11.5",
      "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-6.11.5.tgz",
      "integrity": "sha512-ZarPe1rCHG4aVb78xLuok4BBIm0HMz/Y/CjxYXCk3Qz1mEhS7bPMy6ZhSX2/Dng//R7ei8719j6K87UVM/1b3g==",
      "dependencies": {
        "bson": "^4.7.2",
        "kareem": "2.5.1",
        "mongodb": "4.16.0",
        "mpath": "0.9.0",
        "mquery": "4.0.3",
        "ms": "2.1.3",
        "sift": "16.0.1"
      },
      "engines": {
        "node": ">=12.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/mongoose"
      }
    },

Hi @David_Roegiers,

Thanks for your answer!
I hope your time off was great :slightly_smiling_face:

Still no luck to reproduce on my side with your exact package versions.

The field is a simple string?
How did you configured the edit widget?
And the error happens when you select the empty option of the dropdown, am I right?

Hi @anon34731316

Thanks, it was :slight_smile:

Yes, the field is a string and here is the configuration.

And the error happens when you select the empty option of the dropdown, am I right?

Correct.

Hi @David_Roegiers,

Ok so same conditions than I used too so far… I’m deeply sorry, I still cannot reproduce. I’m still needing some other clues.

  • Is that field nested into an embedded field? Or is it at the root of the collection?
  • Are you using the regular edit form in details view? Or is it somewhere else that we are using it (Workspace, inline edition, etc.)?
  • No call are triggered? The frontend is crashing with an unhandled error and that’s it?

Thanks again for your help and patience.

@anon34731316

No problem, and sorry for my late feedback.

Is that field nested into an embedded field? Or is it at the root of the collection?

Root of the collection.

Are you using the regular edit form in details view? Or is it somewhere else that we are using it (Workspace, inline edition, etc.)?

Regular edit form.

No call are triggered? The frontend is crashing with an unhandled error and that’s it?

No call to the server indeed (except for a call to Segment.io, which I suppose is simple click analytics). Only the error logs in the browser appear.

Shall I try to make a minimal repository to reproduce?

Hello @David_Roegiers,

Sorry for the late reply.

Could you please try again right now?
We’ve just release a little fix that might solve your problem as well.

If it doesn’t, could you please show me all the fields (definition) that you have in the page that is not working properly?
I’m thinking now that it might not be directly linked to the mandatory field we’re talking about - but could be linked to another one displayed in the edit page.

Thank again for your feedback and patience! :pray:

Hello @anon34731316 ,

Thanks for letting me know, the problem still persists though. Below is the definition file of the collection for the frontend. I’m seeing the behaviour for the preferredContact and the gender field, both obligatory with multi-select.

    {
      "actions": [
        {
          "id": "lawyers-0-authenticate-lawyer",
          "name": "Authenticate lawyer",
          "type": "single",
          "baseUrl": null,
          "endpoint": "/forest/_actions/lawyers/0/authenticate-lawyer",
          "httpMethod": "POST",
          "redirect": null,
          "download": false,
          "fields": [],
          "hooks": {"load": false, "change": ["changeHook"]}
        }
      ],
      "fields": [
        {
          "defaultValue": null,
          "enums": [],
          "field": "_id",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": true,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "Free",
          "enums": [],
          "field": "accountType",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": true,
          "enums": [],
          "field": "available",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "awards",
          "integration": null,
          "inverseOf": null,
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "billing",
          "integration": null,
          "inverseOf": "parent",
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "lawyers_billing._id",
          "relationship": "HasOne",
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "canton",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "createdAt",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Date",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "education",
          "integration": null,
          "inverseOf": "parent",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "lawyers_education._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "email",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [
            {"type": "is present", "message": "Field is required"},
            {
              "type": "is like",
              "value": "/^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|.(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/",
              "message": "Value must match /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|.(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/"
            }
          ]
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "experience",
          "integration": null,
          "inverseOf": "parent",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "lawyers_experience._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "firm",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": "firms._id",
          "relationship": "BelongsTo",
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "firmFunction",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "15",
          "enums": [],
          "field": "firstConsultationDuration",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "firstConsultationPrice",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "firstName",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "fullName",
          "integration": null,
          "inverseOf": null,
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "gender",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": false,
          "enums": [],
          "field": "hasFirstConsultation",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": false,
          "enums": [],
          "field": "hasHourlyRate",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": false,
          "enums": [],
          "field": "hidden",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": false,
          "enums": [],
          "field": "hideAge",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "hourlyRate",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "languages",
          "integration": null,
          "inverseOf": "parent",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "lawyers_languages._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "lastName",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "lawyerAdmissionCanton",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "lawyerAdmissionYear",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "lawyerRegistryCanton",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "legalProductOrders_lawyer__manyToOne__inverse",
          "integration": null,
          "inverseOf": "lawyer__manyToOne",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "legalProductOrders._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": false,
          "enums": [],
          "field": "mediator",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "memberships",
          "integration": null,
          "inverseOf": null,
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "office",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": "offices._id",
          "relationship": "BelongsTo",
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "offices_through_offices_lawyers",
          "integration": null,
          "inverseOf": "lawyers_through_offices_lawyers",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "offices._id",
          "relationship": "BelongsToMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "phone",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "poolClaimTemplate",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "practiceAreaGrouping",
          "integration": null,
          "inverseOf": null,
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "practiceAreaGroupingFilter",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": true,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "practiceAreas",
          "integration": null,
          "inverseOf": "parent",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "lawyers_practiceAreas._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "profileText",
          "integration": null,
          "inverseOf": null,
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": {
            "fields": [
              {"field": "manual", "type": "String"},
              {"field": "generated", "type": "String"}
            ]
          },
          "validations": []
        },
        {
          "defaultValue": "generated",
          "enums": [],
          "field": "profileTextSelection",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "publications",
          "integration": null,
          "inverseOf": "parent",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "lawyers_publications._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": null,
          "field": "requests_lawyer__manyToOne__inverse",
          "integration": null,
          "inverseOf": "lawyer__manyToOne",
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": "requests._id",
          "relationship": "HasMany",
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": false,
          "enums": [],
          "field": "showClientMessageInEmail",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": true,
          "enums": [],
          "field": "showContactData",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Boolean",
          "validations": []
        },
        {
          "defaultValue": "unclaimed",
          "enums": [],
          "field": "signUpStatus",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": true,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": [{"type": "is present", "message": "Field is required"}]
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "slug",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "specialCertificates",
          "integration": null,
          "inverseOf": null,
          "isFilterable": false,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": false,
          "isVirtual": false,
          "reference": null,
          "type": ["String"],
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "termsOfUseAccepted",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "title",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        },
        {
          "defaultValue": null,
          "enums": [],
          "field": "updatedAt",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "Date",
          "validations": []
        },
        {
          "defaultValue": "",
          "enums": [],
          "field": "yearOfBirth",
          "integration": null,
          "inverseOf": null,
          "isFilterable": true,
          "isPrimaryKey": false,
          "isReadOnly": false,
          "isRequired": false,
          "isSortable": true,
          "isVirtual": false,
          "reference": null,
          "type": "String",
          "validations": []
        }
      ],
      "icon": null,
      "integration": null,
      "isReadOnly": false,
      "isSearchable": true,
      "isVirtual": false,
      "name": "lawyers",
      "onlyForRelationships": false,
      "paginationType": "page",
      "segments": []
    },

Thanks for your answer David.

In the collection definition you shared I’m not seeing the 2 fields you’re referring to.
Am I missing something?

@anon34731316 Apologies, it’s profileTextSelection not preferredContact. gender seems to be there.

1 Like

Thanks @David_Roegiers :pray:

Looking at the error you shared again, it seems that the issue is coming from the profileText field, and I’m seeing that’s a nested object.
I’ve tried to introduce something similar in my repo but I’m still not able to reproduce the problem… But we’ll get there!

Could you please tell me if you’ve defined flattenMode for your mongoose datasource?
Something like:

  createMongooseDataSource(connection, {
    flattenMode: ...
  }),

Thanks.

Interesting. I do use flattenMode, but not on the mentioned fields. Here is the definition, I use:

export const flattenOptions = {
  asFields: ['languages', 'experience', 'education', 'practiceAreas', 'publications'],
  asModels: ['languages', 'experience', 'education', 'practiceAreas', 'publications', 'billing'],
};

Finally!!
I reproduce your problem :slightly_smiling_face:

We’ll let you know once this is fixed.

Thanks again for your messages and your patience.

1 Like

Hooray!

2 Likes

Hello @David_Roegiers thanks for your feedback.
I’m marking your problem as fixed

Cheers

Hello @David_Roegiers,

Sorry for the late answer

Can you please try again ?

1 Like