-
Notifications
You must be signed in to change notification settings - Fork 56
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
Define the behaviour of overwriting registration messages #2984
Comments
P.S. to reproduce the crashed case, try this one. tedge mqtt pub -r 'te/device/child02//' '{"@type":"child-device","@id":"unique-child"}'
tedge mqtt pub -r 'te/device/child02//' '{"@type":"service","@id":"unique-child"}'
tedge mqtt pub -r 'te/device/child02//' '{"@type":"child-device","@id":"unique-child"}' I created a new bug report dedicated to this #2986 |
First, this is definitely a bug: the mapper should never crash on reception of an expected or ill-formed message.
I agree the specifications for the entity store and entity registration are incomplete. For instance, we have to say that an entity cannot change its type or id over time. But, if so, we must also provide a mean to de-register an entity, so a user will be able to fix a mistake.
Indeed, using MQTT retained messages as the source of truth for entity registration leads to many issues:
My point of viewWe have to:
|
Fully aligned with your proposal @didier-wenzek. Having a dedicated channel for registration and deregistration requests was a requirement that kinda came up during the de-registration API proposal work as well, but was rejected mainly for the lack of consistency between registration and deregistration APIs. But, I'm also convinced that this is the right way forward for the long term. That eases our desire to make My only concern is backward compatibility. Since we can't break backward compatibility so soon, we'll have to continue supporting registration messages published to the direct topics as well. What we can do to make the transition less painful is by making As far as I know, the recently released availability feature is the only one that encouraged users to publish entity updates to the same entity store topics. Since that's a very recent feature, we can hopefully withdraw that API now and mandate that any |
Is your feature improvement request related to a problem? Please describe.
We have a representation of a device as a retained message. Since it's a retained MQTT message, user can overwrite the message payload by sending to the same MQTT topic with a retain flag.
Given that user published this registration message to
te/device/child01//
Afterwards, if user re-publishes the following messages to the same MQTT topic, how thin-edge should behave?
@type
. The new message has different@type
.@id
. The new message has different@id
.The current behaviour (main branch as of commit 6fc5699) together with
tedge-mapper-c8y
are:tedge-mapper-c8y
crashed after re-publishing a message with"@type":"child-device"
. See this comment.child01-2
is created.There could be more scenarios.
Describe the solution you'd like
We have to check if the current behaviour is as expected for such erroneous cases. If not, we have to fix them. Probably some behaviour are not even defined.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: