You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you for providing this very useful library.
I found a few issues in the implementation of IoT device shadow deltas:
It looks like moto computes delta as the difference from desired to reported. This is backward; it should be the difference from reported to desired.
Keys that are present in reported but not desired should not be included in delta. If desired is empty or not present, delta should not be present at all.
Hi, thank you for providing this very useful library.
I found a few issues in the implementation of IoT device shadow deltas:
delta
as the difference fromdesired
toreported
. This is backward; it should be the difference fromreported
todesired
.reported
but notdesired
should not be included indelta
. Ifdesired
is empty or not present,delta
should not be present at all.None
as value is not deleting key but is saved askey: None
#3850 fixed deleting keys by setting them tonull
, it still savesnull
as the value if the key was not already present.replace
are not JSON serializable and cause a TypeError.Let me know if I should create separate issues for some or all of these. Thank you for working on moto!
Test cases:
1: (key present in both reported and desired, values differ)
Input:
AWS response:
Moto response:
2: key present in reported, absent from desired
Input:
AWS response:
Moto response:
2a: desired absent entirely
Input:
AWS response:
Moto response:
3: setting a previously absent key to
null
Input:
AWS response:
{ "state": { } }
Moto response:
4: TypeError when one or the other (but not both) of reported and desired is an empty map
Input:
AWS response:
Moto response:
The text was updated successfully, but these errors were encountered: