We have ended up with logic in two places accounting for the same situation: materialising documents when their dependencies arrive late/out of order. Originally we never accounted for this by default, only for schema documents, this is taken care of in the schema task itself, by handling both schema_definition_v1 and schema_field_definition_v1 operations, and in the case of the latter, doing a reverse lookup for any parents.
Now though, since https://github.com/p2panda/aquadoggo/pull/434 we take care of this case for all documents, by issuing dependency tasks for any potential "inverse relations" (identified by schema) of the tasks' document view:
The solution is to remove the logic in the schema task, and only issue schema tasks for schema_definition_v1 documents. Additionally we should check in the schema task if the schema already exists before undertaking any more expensive work. These changes are the same as what was needed in blob task https://github.com/p2panda/aquadoggo/issues/574
We have ended up with logic in two places accounting for the same situation: materialising documents when their dependencies arrive late/out of order. Originally we never accounted for this by default, only for schema documents, this is taken care of in the
schema
task itself, by handling bothschema_definition_v1
andschema_field_definition_v1
operations, and in the case of the latter, doing a reverse lookup for any parents.https://github.com/p2panda/aquadoggo/blob/a831c87844e795cbb9a8013f0f39f935460ef065/aquadoggo/src/materializer/tasks/schema.rs#L39-L43
Now though, since https://github.com/p2panda/aquadoggo/pull/434 we take care of this case for all documents, by issuing dependency tasks for any potential "inverse relations" (identified by schema) of the tasks' document view:
https://github.com/p2panda/aquadoggo/blob/a831c87844e795cbb9a8013f0f39f935460ef065/aquadoggo/src/materializer/tasks/dependency.rs#L144-L147
The solution is to remove the logic in the
schema
task, and only issueschema
tasks forschema_definition_v1
documents. Additionally we should check in theschema
task if the schema already exists before undertaking any more expensive work. These changes are the same as what was needed inblob
task https://github.com/p2panda/aquadoggo/issues/574