-
Notifications
You must be signed in to change notification settings - Fork 408
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
Client doesn't allow you to delete "Single" instance objects. #599
Comments
Hi thanks you to reporting this. Just to be sure, you are talking about DELETE operation from a LWM2M server ? not a LWM2M bootstrap Server ?
I'm not sure this is an issue. Looking at the specification I understand "the object must be supported" as "object should be present but it could have no instances". (§ 5.7) : This seems to confirms that mandatory does not means must not be deleted.
I can see the issue but the spec seems to say that we can delete it 😕 So concretely what does it means :
I think this is an issue, we should fix this. Re-reading the specification I think we should be able to delete any instance except for device 3. WDYT ? |
Yes, I'm talking about the DELETE operation in the Device Management Interface. You're completely right. After checking again Appendix D.1, the "Mandatory" field's description - it's a field for mandatory support of that object, not for mandatory existence of that object (as I thought...). I've probably got confused with the "Instances" field's description, where they use the "Mandatory" field in the sense of mandatory existence. And looking at the "Instances" field's description again, it says it all: This completely agrees with your last statement as well. The only MUST existing object instances in the client, have to be Single and Mandatory objects - currently, that's only the Device object. And it's explicitly stated that he MUST NOT be affected by a DELETE operation. This means that every other object instance can be non-existent in the client, and can get deleted. So, for your points about the Server object (bootstrap/no bootstrap and one/several LwM2M server) - after the specification doesn't forbid us to delete, I don't think we should (where ACL allows us to delete, of course). So yes, the only real issue here is that the client doesn't allow you to delete "Single" instance objects. |
I agree that the specification say nothing about this, but if we have not bootstrap server configuration and we delete the last server instance, we just brick our Leshan client. It sounds not a so good idea... 😕
I plan to fix it by just forbidding object 3 deletion. This could maybe also make sense to let user being able to make an instance "undeletable". |
I finally found time to fix this bug. |
Yes, it looks fixed. |
(fixed in master, thx to reporting this !) |
Hi everyone,
When sending a delete request, the Leshan client checks only if the object is Multiple, and if it is - allows you to delete the instance. I think that is a problem, because:
I am able to delete all instances for an object that is Multiple and Mandatory. For example, the Server object. If I have one instance, I can delete it without error, and that leaves me without a mandatory Server object. Of course, I can make that validation at my application level, just don't know if that's the idea.
I'm not able to delete the instance for an object that is Single and Optional. The client responses with "METHOD_NOT_ALLOWED" error, when you're trying to delete the instance of a Single object, without checking if that object is Optional. For example, the the client allows you to delete all instances of the Access Control object (witch is Optional, but Multiple), and doesn't allow you to delete the Location object (witch is also Optional, but Single).
The text was updated successfully, but these errors were encountered: