-
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
Understanding RegistrationStore#addObservation #452
Comments
The quick answer : It's an ugly bug in RedisRegistrationStore ! Thx to report this ! About what we try to achieve in addObservation, you're right : "Why this method exists?" is explained in #425. But to summarized it here.
I totally understand how much all of this must be confusing. I really would like to make it clearer.
|
So, at the moment the idea of the leshan observation layer is to keep just 1 observation per client, right? What would be the problem if we keep several observations for a client? In this case, they will be removed when the client is deregistered. |
the leshan observation layer is to keep just 1 observation by LWM2M client and by path. Why not allowing 2 observe relations for same client / same path ?
But this is an open discussion :) |
thanks. |
Previously I created a ticket related to some confusion with the intention of this method (see #425).
Now, I'm implementing a
RegistrationStore
and I'm getting confused by this method again.InMemoryRegistrationStore#addObservation is removing existing observations matching the registration id, the path, and not matching the current observation id, which means that we'll keep at most 1 observation. This is because at first californium add its observation and then this method is called, which is removing every observation but the current one.
RedisRegistrationStore#addObservation is using the same logic with the difference that it's never executed leading to not removing any observation, see:
The question is, what is this method really supposed to do? I'm thinking that it might be better to just do nothing and possibly removing the method to avoid confusion.
Thanks.
The text was updated successfully, but these errors were encountered: