lightblue-platform / lightblue-audit-hook

Audit hook for lightblue.
GNU General Public License v3.0
1 stars 9 forks source link

auto-generate _id #55

Closed dcrissman closed 9 years ago

dcrissman commented 9 years ago

Fixes this exception.

2015-09-30 09:55:09,992 [hystrix-UpdateCommand-10] ERROR [com.redhat.lightblue.hook.audit.AuditHook] {"data":{"entityName":"myEntity","versionText":"1.0.6-SNAPSHOT","lastUpdateDate":"20150930T09:55:09.929-0400","lastUpdatedBy":"me","CRUDOperation":"UPDATE","identity":[{"fieldText":"field1","valueText":"value1"},{"fieldText":"field2","valueText":"value2"}],"audits":[{"fieldText":"description","oldValue":"another new value, but from Dennis6","newValue":"another new value, but from Dennis7"}],"identity#":2,"audits#":1,"objectType":"audit"},"errors":[{"objectType":"error","context":"rest/UpdateCommand/myEntity/update(myEntity:1.0.6-SNAPSHOT)/audit/1.0.2-SNAPSHOT/insert(audit:null)/validateDocs/validateDoc/_id/identity","errorCode":"crud:Required","msg":"_id"}]}
dcrissman commented 9 years ago

@bserdar, @jewzaam - This is the exception we discussed this morning. I attempt to fix it by adding an auto-generated UUID as _id.

bserdar commented 9 years ago

Yes, this masks another bug. So with the latest change we made by not generating _id, we also created a new bug: if _id is required or an identity, the mediator doesn't know _id will be generated by the backend, and fails in constraint validation.

dcrissman commented 9 years ago

Replaced by https://github.com/lightblue-platform/lightblue-core/issues/489

Closing.