Skip to content

Static property update adds a rogue 'mmsi' property to target path #1221

@preeve9534

Description

@preeve9534

I have a plugin which maintains some paths and I want to add a meta value alongside the data path which describes the path value and its units. So, I want to use static property update.

Before the static update is executed the target key does not exist in the Signal K tree.

I generate a delta expressing the required static update.

var delta = {
  context: 'vessels.urn:mrn:imo:mmsi:235115158.environment.sunphases.dawn',
  updates: [{
    values: [ { "path": "", "value": {
      "meta": { description": "Morning nautical twilight ends, morning civil twilight starts", "units": "ISO-8601 (UTC)" }
    }} ]
  }]
};

And commit it with app.handleMessage.

After the update my path value is:

{
  "mmsi": "235115158",
  "meta": {
    "description": "Morning nautical twilight ends, morning civil twilight starts",
    "units": "ISO-8601 (UTC)"
  }
}

So, the meta property has been added just fine, but where has that pesky 'mmsi' property appeared from?. A ghost in the machine?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions