Open StFS opened 5 months ago
Can you reproduce this with a local installation using the JDBC registry with PostgreSQL? The integration tests of Hono include a test case that verifies searching by (nested) string-typed fields, but the embedded H2 based JDBC registry that is used on the Sandbox seems to have problems with this and sorting ...
I have reproduced this issue running on a fresh installation to my docker-desktop embedded k8s cluster. That setup has a PSQL DB underneath the JDBC based device registry. I'm seeing this behavior there as well.
Can you create a verifier (test case) for it?
According to the documentation, searching for devices can be done using a predicate specified by the
filterJson
request parameter. The example in the documentation for example is{"field": "/ext/brand","value": "eclipse*"}
indicating that searching in nested fields should be supported.However, it seems that it is not as demonstrated by the following example run against the Hono sandbox setup.
First we'll get a list of the devices that are registered on the
DEFAULT_TENANT
:Here we see that there is a device registered that we can try searching for by filtering on the value of
/ext/ep
:If we perform a GET request using
{"field": "/ext/ep","value": "IMEI4711"}
as thejsonFilter
value, we see that no device is returned:When trying to search by the
/id
field using thejsonFilter
value of{"field": "/id","value": "1234"}
, that does not work either:However, if we search for devices that have the
enabled
field set to atrue
value, that seems to work as we only get the subset of devices that actually have that set:Note that we're only getting 3 devices with this query while we got 5 devices with our original query (using no
jsonFilter
).So my gut feeling is that this must be a bug.