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
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');
?
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?
Are you 100% sure that the error you’re getting if due to this missing value?
Thanks for your answer!
I hope your time off was great
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?