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
Reusing EUIs of Deleted Gateways #1120
Comments
Related to #1121 |
I updated this issue a bit to have a slightly different scope than #1121, which we can make more about restoring deleted entities in general (instead of only applications). In the current issue, let's focus more on adding new gateways with the same EUI as a deleted gateway. |
Related to #604 (releasing IDs/EUIs) |
@htdvisser even having #1703 (now in Next Up) is not entirely covering the common use case of being able to create a gateway with an EUI that has been used before. Looping in an administrator to purge an entity is not a nice user experience, plus purging an entity is more destructive than simply releasing the EUI. Afaik we don't have security issues with releasing the EUI when deleting the gateway. It is optional already. It would, obviously, make recovery partial, i.e. the EUI is gone, but I think that is acceptable and also aligns with how device EUIs are released on deletion immediately. Can we close this issue with simply releasing the EUI on gateway delete? If not, why not? |
Yes, we could update the Gateway EUI field to nil/NULL on delete. Should be as simple as adding a // AfterDelete releases the EUI of a Gateway after it is deleted.
func (gtw *Gateway) AfterDelete(db *gorm.DB) error {
return db.Unscoped().Model(gtw).UpdateColumn("gateway_eui", nil).Error
} in |
@bafonins can you pick this up? |
@adamsondelacruz please reopen if #1843 doesnt solve the issue. |
Summary
When you delete a gateway and then add a new one with the same EUI, if fails because it complains that the gateway already exists.
Steps to Reproduce
What do you see now?
What do you want to see instead?
Successfullly create the new gateway
Environment
amazon linux using TTN CLI and Postman using API Call
How do you propose to implement this?
When user try to insert a deleted gateway, update the deleted flag to false
Can you do this yourself and submit a Pull Request?
...
The text was updated successfully, but these errors were encountered: