FIWARE / context.Orion-LD

Context Broker and CEF building block for context data management which supports both the NGSI-LD and the NGSI-v2 APIs
https://www.etsi.org/deliver/etsi_gs/CIM/001_099/009/01.06.01_60/gs_CIM009v010601p.pdf
GNU Affero General Public License v3.0
50 stars 43 forks source link

"-noNotifyFalseUpdate" - notification cycles a certain number of times #917

Open sekiguchi-yohei opened 3 years ago

sekiguchi-yohei commented 3 years ago

Hi.

An unintended event occurred with "-noNotifyFalseUpdate". If the value field of an attribute of an entity sent in a notification is an object, the notification was repeated a certain number of times. (Same event as in issues/907) https://github.com/FIWARE/context.Orion-LD/issues/907

NG

{
    "id": "urn:ngsi-ld:Person:person001",
    "type": "Person",
    "name": {
        "type": "Property",
        "value": "person001"
    },
    "birthDate": {
        "type": "Property",
        "value": {
            "type": "DateTime",
            "value": "1992-07-16T11:00:00.00Z"
        }
    }
}

version

{
  "orionld version": "post-v0.8.1",
  "orion version":   "1.15.0-next",
  "uptime":          "0 d, 18 h, 45 m, 18 s",
  "git_hash":        "nogitversion",
  "compile_time":    "Mon Jul 26 20:31:37 UTC 2021",
  "compiled_by":     "root",
  "compiled_in":     "buildkitsandbox",
  "release_date":    "Mon Jul 26 20:31:37 UTC 2021",
  "doc":             "https://fiware-orion.readthedocs.org/en/master/"
}
kzangeli commented 3 years ago

Yeah, that is what is implemented. I implemented for Orion-LD exactly was is implemented for Orion and that is a comparison old/new value if not compound.

It's a lot more effort to compare compound values. But, if this is what you need, I'll have to implement it.

kzangeli commented 3 years ago

Yeah, that is what is implemented. I implemented for Orion-LD exactly was is implemented for Orion and that is a comparison old/new value if not compound.

It's a lot more effort to compare compound values. But, if this is what you need, I'll have to implement it.

sekiguchi-yohei commented 3 years ago

Hi.

Sorry I hadn't done a similar test with V2...(value field of an attribute of an entity) It will be difficult for you to implement this, so we will look into other ways to achieve this.

Thank you very much.

kzangeli commented 3 years ago

Yeah, it is far from trivial. A recursive tree comparison algorithm on two trees that must first be sorted ... Only, how do you sort a possible mix of strings, numbers, bools, objects, arrays ...

However, it's doable and not a bad addition to the broker, so, let's keep this issue open and once I'm back from my parental leave (had a daughter, Emily, yesterday :)) I will try to find time to implement this

sekiguchi-yohei commented 3 years ago

Congratulations on your new baby! I'm really looking forward to seeing it implemented.

kzangeli commented 3 years ago

So, I have the implementation ready and working in my developer machine. For some reason the functest for this "new feature" fails in github actions. With some luck I'll find the reason for this soon and can merge the pull request into develop! It depends a little ( a lot! ) on how much time my wife lets me have behind the keyboard ... :)

sekiguchi-yohei commented 3 years ago

Thanks for the fix! Looking forward to your revised version! (However, please don't try too hard and upset your wife...)

kzangeli commented 3 years ago

So, hopefully fixed. Bear in mind that arrays cannot be sorted, i.e. [ 1, 2 ] is not the same as [ 2, 1 ]. Objects are sorted. Please test and let me know (by a comment and closing of the issue if all is good).

sekiguchi-yohei commented 3 years ago

Thanks for the quick response! After testing, I can confirm that the problem has been resolved.