-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does deleting an object instance implicitly delete observations under the instance? #558
Comments
Hi, The LWM2M observation feature is based on RFC7641 - Observing Resources in the Constrained Application Protocol (CoAP). Looking at RFC7641§3.2 Notifications, you can read :
and at RFC7641§4.2 Notifications :
(Note in LWM2M, the LWM2M client acts as a CoAP server and vice versa ) So In a general way, I understand that if the object instance is deleted (for any reason), the LWM2M client (CoAP server) should send a 4.04 Not Found, then removes the observation relation. I guess LWM2M server (CoAP client) should also consider the relation is removed when he received a notification with a non-2.xx response code.
I understand it should reinstall. (Note that I'm not author of any those specifications LWM2M or CoAP) |
Group comments that if a client device removes an object or said instance, the device shall re-register with said servers and all observations shall be considered invalid. See lwm2m 1.2 "The Object Instance that is deleted in the LwM2M Client by the LwM2M Server MUST be an Object Instance that is announced by the LwM2M Client to the LwM2M Server using the "Register" and "Update" operations of the Client Registration Interface." |
See Section 6.3.7 Delete |
A "Register" OR "Update" operation can be used to update supported Object/Instances.
It could work but If lot of observe relation was established, this advice will lead to more traffic :
There is also some question about timing because here question was about remove than add again an instance. My 2 cts, I will not go on that way. It sounds better to follow CoAP RFC and send a 4.0.4 not found to notify server that relation is not established anymore. then just do 1 or several "Update" to notify that instance is deleted/added then up to the server to decide if it want to reestablished the observe relation on update or not. |
The LwM2M spec does not specify what happens to an object instance's observations when a server deletes the object instance.
For example, if a server has installed an observation on /5/0/3, then deletes /5/0 and subsequently creates a new /5/0, should the server assume that the observation on /5/0/3 no longer exists, and should be reinstalled?
Thanks,
Bryan
The text was updated successfully, but these errors were encountered: