Hi Guys, I have the following schema:
export const TAG_SCHEMA = schema({
data: schema.LoroMap({
name: schema.String({required: true}),
description: schema.String(),
}),
});
If I do:
const doc = new LoroDoc()
doc.getMap('data').set('name', null)
const tag = new Mirror({
doc,
schema: TAG_SCHEMA,
checkStateConsistency: true
})
tag.checkStateConsistency() // no error is thrown here
The same for:
const doc = new LoroDoc()
const tag = new Mirror({
doc,
schema: TAG_SCHEMA,
checkStateConsistency: true,
initialState: {data: {name: null, description: null}}
})
tag.checkStateConsistency() // no error is thrown here
It seems that validation only happens in the setState() method, am I doing something wrong?