Skip to content
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

Error on duplicate object_id #178

Closed
FWuellhorst opened this issue Dec 7, 2022 · 5 comments · Fixed by #279
Closed

Error on duplicate object_id #178

FWuellhorst opened this issue Dec 7, 2022 · 5 comments · Fixed by #279
Assignees
Labels
feature request Request a potential feature

Comments

@FWuellhorst
Copy link
Contributor

Is your feature request related to a problem? Please describe.
If a device as two attrs with the same object_id, fiware would randomly send the value to only one attr.

Describe the solution you'd like
Warn / throw errors in that case for a device-config.

@FWuellhorst FWuellhorst added the feature request Request a potential feature label Dec 7, 2022
@djs0109
Copy link
Contributor

djs0109 commented May 30, 2023

Good points! However, regarding the latest function that iotagent provides check here, I would even suggest that the name of attrs can be duplicated but the object_id must be unique

@djs0109
Copy link
Contributor

djs0109 commented May 30, 2023

@tstorek what is your opinion on this?

@tstorek
Copy link
Collaborator

tstorek commented May 30, 2023

@djs0109 Yes, that is correct. The final decision maker is always the object_id. This is also used in the expression language FIWARE provides. The name is just lovely to have for the user. In the database, I think name is even copied to opject_id if omitted.

I would suggest that a device request checks if the object_id is already taken. Hence, for a complete update of the device, the model can check for it, and partial updates would require getting the whole device config first.

However, @FWuellhorst Are you sure that the IoT-Agent is not checking on this in the current version?

@djs0109 djs0109 self-assigned this Apr 30, 2024
Copy link

Branch 178-Error-on-duplicate-object_id created!

@djs0109
Copy link
Contributor

djs0109 commented Apr 30, 2024

Refactor plan:

  • Not require object_id
  • If object_id is given, it should be unique
  • Device attribute name must not be unique

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request a potential feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants