electrodb
electrodb copied to clipboard
Setter not triggered on removing a watching attribute
Describe the bug
with attribute updatedAt having property watch: ['status']
the attribute updatedAt setter is not triggered when patch.remove() is called to remove the attribute status
it works as expected when watch: '*' is set
ElectroDB Version
2.13.1
ElectroDB Playground Link config with watch as array of attribute names config with watch as wildcard
Entity/Service Definitions
{
model: {
entity: "tasks",
version: "1",
service: "taskapp"
},
attributes: {
id: {
type: "string",
required: true
},
status: {
type: 'string'
},
createdAt: {
type: "number",
default: () => Date.now(),
readOnly: true
},
updatedAt: {
type: "number",
watch: ['status'],
set: () => Date.now(),
readOnly: true
}
},
indexes: {
projects: {
pk: {
field: "pk",
composite: ["id"]
},
},
}
}
Expected behavior
The setter of updated_at should be triggered on removing status attribute with patch.remove()
Thank you, I will look into this!