Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Leshan Client : BootstrapDeleteRequest triggers *all* objects instances to be deleted #1387

Closed
cyril2maq opened this issue Jan 25, 2023 · 4 comments · Fixed by #1389
Closed
Labels
bug Dysfunctionnal behavior client Impact LWM2M client

Comments

@cyril2maq
Copy link

Version(s)

9859a33

Which components

leshan client

Tested With

No response

What happened

When the client receive a BootstrapDeleteRequest, it leads to clear all its objects instances whatever the 'path' value of the request is. Indeed in the following code, the 'objects' field contains all objects declared in the client :

https://github.com/eclipse/leshan/blob/122a1a8556f659f2a9b43ef81d4250672bc72e22/leshan-client-core/src/main/java/org/eclipse/leshan/client/bootstrap/BootstrapHandler.java#L95-L97

A filter matching the objects and the BootstrapDeleteRequest path is missing.

(the BootstrapDeleteRequest path must still match one of the client object, else the request will be rejected beforehand in ServerMessageDeliverer due to the findResource check).

I think the key point is that previously in M10, the instance/request filtering was made at ObjectResource level where it used a dedicated nodeEnabler (restricted to the targeted objectId) instead of the generic DownlinkRequestReceiver which will trigger the call to BootstrapHandler.delete and iterates on all the client's objects.

How to reproduce

Setup a leshan bootstrap server.
Setup a leshan-client in bootstrap mode, with several objects in its model.
Setup a Bootstrap sequence for this client with a BootstrapConfig having 'toDelete' with just '/0'.

All objects instances of the client are in fact cleared instead of just '/0' ones.

Relevant Output

No response

@cyril2maq cyril2maq added the bug Dysfunctionnal behavior label Jan 25, 2023
@sbernard31 sbernard31 added the client Impact LWM2M client label Jan 25, 2023
@sbernard31
Copy link
Contributor

Thx for your very clear reports 🙏 !

It seems you catch another bugs 🙂, I will work on it !

@sbernard31
Copy link
Contributor

#1389 should fix this let me know, if you plan to review/test it 🙏

@cyril2maq
Copy link
Author

cyril2maq commented Jan 26, 2023

I tested it OK 👏

I also had a look to the PR, look good to me.

@sbernard31
Copy link
Contributor

PR #1389 is now integrated in master.

Thx again for your help 👍

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Dysfunctionnal behavior client Impact LWM2M client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants