Closed aaj3f closed 1 year ago
I ran through this in a db repl and wasn't able to replicate the error, so I suspect this is a context related bug. Once the context fixing has landed I will re-evaluate.
Here's my repro attempt for the record:
(comment
(def conn (test-utils/create-conn))
(def ledger @(fluree/create conn "retract-and-replace"))
(def db0 (fluree/db ledger))
(def db1 @(fluree/stage db0 {"@type" "sh:NodeShape",
"sh:targetClass" {"id" "schema:Person"},
"sh:name" "schema:Person",
"sh:property"
[{"sh:path" {"id" "schema:familyName"},
"sh:name" "schema:familyName",
"sh:datatype" {"id" "xsd:string"}}]}))
@(fluree/query db1 {:select {"?s" ["*"]}, :where [["?s" "sh:property" "?property"]]})
[{:id "_:f211106232532992",
:rdf/type ["sh:NodeShape"],
"sh:targetClass" {:id "_:f211106232532993"},
"sh:name" "schema:Person",
"sh:property" {:id "_:f211106232532994"}}]
(def db2 @(fluree/stage @(fluree/commit! ledger db1)
{"@id" "_:f211106232532992",
"sh:property"
[{"sh:path" {"id" "schema:age"},
"sh:name" "schema:age",
"sh:datatype" {"id" "xsd:string"}}]}))
@(fluree/query db1 {:select {"?s" ["*"]}, :where [["?s" "sh:property" "?property"]]})
[{:id "_:f211106232532992",
:rdf/type ["sh:NodeShape"],
"sh:targetClass" {:id "_:f211106232532993"},
"sh:name" "schema:Person",
"sh:property" {:id "_:f211106232532994"}}]
)
Thanks, @dpetran -- I'm making a list of all the bugs/issues that are probably http-api-gateway context/serialization-specific, and this is one of them. I have a collection of tests for each of them in Postman and once the topic branch is PR'd and merged, I do plan to test them w/ that collection and if they're fixed out-of-the-box, I'll just close them outright
I wonder if we want to add a label for that temporarily to make it easier to flag them
Currently, any update to a property's value on a subject where that subject already has a value on that property will perform a retract-and-replace. In this bug, however, the retract-and-replace commit causes a fatal ledger issue where subsequent queries/commits fail with a
"Cannot invoke \"java.lang.Character.charValue()\" because \"x\" is null"
error.Creation transaction 1:
Query (to retrieve blank node id)
Retract-and-replace transaction
Any subsequent queries or transactions return