SensorThings Observations Chart is empty when string IDs are configured in FROST-Server

Issue #660 resolved
Ilias Kotinas created an issue

FROST-Server allows the usage of UUIDs and String keys in all entities. See https://fraunhoferiosb.github.io/FROST-Server/settings/settings.html under the persistence section. The keys can be provided by the client as well (see persistence.idGenerationMode setting). This has some benefits if someone has already a unique primary key for their data (for idempotent operations etc.).

The function isObservation() at staTools.js returns false if the “@iot.id” field (the primary key) is not a number. Therefore the chart is empty if the FROST-Server is configured with String keys.

Removing the line && typeof observation["@iot.id"] === "number" fixes the issue.

For non-developers, in the minified version, one can remove the above line by running:

sed -i 's/&&"number"==typeof e\["@iot.id"\]//g' masterportal.js

Comments (4)

  1. Log in to comment