p2panda / aquadoggo

Node for the p2panda network handling validation, storage, aggregation and replication
GNU Affero General Public License v3.0
69 stars 5 forks source link

Fix: query for child relations fails when relation list empty #614

Closed sandreae closed 2 months ago

sandreae commented 2 months ago

This error occurred because the query get_child_document_ids assumed values would never be null, however when a relation list is empty then a null value occurs in operation_field_v1. This was hard to spot as it only occurs when the node is backed by a postgres database, when using Sqlite unexpected null values are simply ignored.

https://github.com/p2panda/aquadoggo/blob/086d4249ecb43b07a056d1005628467713c19aeb/aquadoggo/src/db/stores/document.rs#L402

📋 Checklist