Commit 17670dc8 authored by kzangeli's avatar kzangeli
Browse files

Merge branch 'fix/008-temporal-update-appends' into integration/all-fixes

# Conflicts:
#	testsuite-doubts.md
parents 9cacfa7d 167fa185
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -2,6 +2,11 @@
      "id":"urn:ngsi-ld:Vehicle:randomUUID",
      "type":"Vehicle",
      "speed":[
         {
            "type":"Property",
            "value":120,
            "observedAt":"2020-09-01T12:03:00Z"
         },
         {
            "type":"Property",
            "value":121,
@@ -12,6 +17,11 @@
            "value":80,
            "observedAt":"2020-09-01T12:05:00Z"
         },
         {
            "type":"Property",
            "value":80,
            "observedAt":"2020-09-01T12:05:00Z"
         },
         {
            "type":"Property",
            "value":100,
@@ -24,6 +34,16 @@
            "value":67,
            "observedAt":"2020-09-01T12:03:00Z"
         },
         {
            "type":"Property",
            "value":67,
            "observedAt":"2020-09-01T12:03:00Z"
         },
         {
            "type":"Property",
            "value":53,
            "observedAt":"2020-09-01T13:05:00Z"
         },
         {
            "type":"Property",
            "value":53,
+22 −0
Original line number Diff line number Diff line
@@ -3236,3 +3236,25 @@ expect 1. Verified by tracing each leaked entity id in the robot
**Fix:** teardown deletes the current-state entity too — `Delete Entity`
before `Delete Temporal Representation Of Entity` (that order also purges
the deletion's own tombstone rows from the temporal store).


## 94. `008_01_01` — expectation assumes a second temporal POST overwrites same-observedAt instances

**Hit:** `Item root['speed'][1] added to iterable` (and friends) — the broker
returns more Attribute instances than the expectation contains.

**Analysis:** the test POSTs `/temporal/entities` twice for the same entity:
the create payload (`speed` 120@12:03, 80@12:05) and an "update" payload
(`speed` 121@12:03, 80@12:05, 100@12:07). The expectation file is the update
payload itself — i.e. it assumes the second POST *replaced* the instances
sharing an `observedAt` (120@12:03 → 121@12:03) and deduplicated the
identical ones (80@12:05). That is current-state update semantics applied to
the Temporal Evolution. Per TS 104-175 § 5.6.11.4, when the entity already
exists, the provided Attribute instances "shall be **added** to the existing
Temporal Representation" — instance identity is the system-generated
`instanceId`, never `observedAt`, and the evolution is append-only. A
conforming broker therefore returns the union: 5 `speed` instances
(120@12:03, 121@12:03, 80@12:05 ×2, 100@12:07) and 6 `fuelLevel` instances.

**Fix:** the expectation now carries the full union (including the duplicate
same-value/same-observedAt instances, which exist as distinct `instanceId`s).