Cole Greer created TINKERPOP-3300:
-------------------------------------
Summary: EventStrategy misses on property-removed events when
property() narrows cardinality (list/set to single)
Key: TINKERPOP-3300
URL: https://issues.apache.org/jira/browse/TINKERPOP-3300
Project: TinkerPop
Issue Type: Improvement
Components: process
Affects Versions: 3.8.2
Reporter: Cole Greer
AddPropertyStep.captureRemovedProperty() assumes a property() call removes at
most one existing property. That holds for graphs that are always single, set
or list, but not when the write changes the key's cardinality. For example, a
single-cardinality write over a key holding multiple list or set values drops
all of them:
{code:java}
gremlin> g.addV().property(list, "email", "[email protected]").property(list,
"email", "[email protected]")
gremlin> g.V().property(single, "email", "[email protected]")
gremlin> g.V().valueMap()
==>[email:[[email protected]]]
{code}
Both original values are removed, but EventStrategy listeners can be notified
of at most one removal, so the rest are missed.
Fix: rework removed-property tracking so a single property() call can report
every removed property, and emit one removal event for each (plus the
addition). Add tests for list to single and set to single transitions with a
registered listener.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)