Files
floci/compatibility-tests/sdk-test-python/tests
Mario Toffia 534571b2a3 feat(iot): route shadow events through topic rules (#5260)
* feat(iot): route shadow events through topic rules

Successful classic and named shadow changes, from the REST API and from MQTT
reserved topics, now reach the topic rules engine and MQTT subscribers on the
AWS response topics with AWS payload shapes. Shadow documents keep metadata,
clientid() reports N/A for messages without an MQTT client, and MQTT rejected
responses carry the numeric status code.

Closes floci-io/floci#5256

* fix(iot): compute the shadow delta through nested objects

GetThingShadow and the update/delta event compared desired and reported only at the top level, so one differing nested field put the whole desired object in the delta. AWS compares nested objects key by key and arrays whole, and the delta event carries the stored desired metadata of exactly the delta values.

* fix(iot): give a shadow stored without metadata its leaf metadata

A shadow persisted before metadata was kept now reads back with a metadata mirror of its state stamped with its stored timestamp, so GetThingShadow and the update/documents and update/delta events carry metadata for its existing leaves, as AWS does for every state leaf.

* fix(iot): reject a shadow name outside the AWS pattern

A whitespace-only shadow name no longer addresses the classic shadow, so DELETE ?name=%20 cannot delete it. As on AWS, an empty name is the classic shadow and any name that is not 1 to 64 of [a-zA-Z0-9:_-] fails with InvalidRequestException.

* fix(iot): ignore a shadow request on a named topic with an invalid name

As on AWS, an MQTT request on $aws/things/<thing>/shadow/name/<name>/<op> whose name is not a valid shadow name, empty included, is not a shadow request: nothing is published and the classic shadow is untouched. Before, an empty name updated the classic shadow and a blank one was rejected on the classic shadow's topic.

* docs(iot): note that wildcard rule filters receive shadow events

Verified on AWS IoT: rules FROM '#' and '+/things/<thing>/shadow/#' receive the $aws shadow update events. Adds a test locking in the existing matcher behavior.

* fix(iot): keep only the most recent recorded publish events

The recorder kept every publish, and shadow events now go through it too. Only tests read it, so it now keeps the most recent 1,000 events and drops the oldest.

* test(iot): read shadow rule queues without the 5s poll

* fix(iot): match AWS shadow names, delta numbers and clientToken echo

Accept the reserved $package shadow name and reject any other name containing $ with 'Invalid shadow name : <name>'; a name failing the pattern answers 'Bad Request'. Compare delta numbers as AWS does (equal when both double and long values are, integers beyond long exactly), which also stops a number beyond the double range failing the update, and echo a whitespace clientToken.
2026-10-16 20:47:34 -04:00
..
2026-04-11 09:59:05 -05:00
2026-04-11 09:59:05 -05:00
2026-04-11 09:59:05 -05:00
2026-04-11 09:59:05 -05:00