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

[feature] Add a device name changed signal, connect it to refresh the notifications cache #361

Closed
nemesifier opened this issue Jan 7, 2021 · 3 comments · Fixed by #407
Closed

Comments

@nemesifier
Copy link
Member

nemesifier commented Jan 7, 2021

Blocked by openwisp/openwisp-notifications#164.
We should first confirm that openwisp/openwisp-notifications#164 can be done and then we can move on with this.

Like #241 but emitted when the name is changed.
PS: there's already a few lines of code which find out if the name has changed:

if self.name != current.name and self._has_config():
self.config.set_status_modified()

We can change the implementation to be like #241, which doesn't need an extra DB query which could be good to optimize the system a bit.

Addendum

I want to make clear what the issue is: right now the issue is that when the name of a device is changed, the notifications keep referring to it with the old name.

When a new device registers, it registers using the mac address as the name, then an operator usually changes its name to something more human readable, but the notification keep referring to it with the mac address.

@nemesifier
Copy link
Member Author

PS: there's already a few lines of code which find out if the name has changed:

if self.name != current.name and self._has_config():
self.config.set_status_modified()

We can change the implementation to be like #241, which doesn't need an extra DB query which could be good to optimize the system a bit.

@nemesifier
Copy link
Member Author

This is ready to be worked on, depends on openwisp/openwisp-notifications#168 which is ready, so that branch can be installed by editing the requirements.txt this way:

openwisp-notifications @ https://github.com/niteshsinha17/openwisp-notifications/tarball/issues/164-introduce-mechanism-to-clear-cache

@codesankalp
Copy link
Member

I would like to work on it.

codesankalp added a commit to codesankalp/openwisp-controller that referenced this issue Mar 13, 2021
Added `device_name_changed` signal and connect it to refresh the notifications
cache.

Closes openwisp#361
codesankalp added a commit to codesankalp/openwisp-controller that referenced this issue Mar 21, 2021
Added `device_name_changed` signal and connect it to refresh the notifications
cache.

Closes openwisp#361
@nemesifier nemesifier added the Important Higher priority or release blocker label Mar 25, 2021
codesankalp added a commit to codesankalp/openwisp-controller that referenced this issue Mar 26, 2021
Added `device_name_changed` signal and connect it to refresh the notifications
cache.

Closes openwisp#361
OpenWISP Contributor's Board automation moved this from To do (Python & Django) to Done Apr 3, 2021
OpenWISP Priorities for next releases automation moved this from Backlog to Done Apr 3, 2021
nemesifier pushed a commit that referenced this issue Apr 3, 2021
Added `device_name_changed` signal.
Connected it to a receiver which refreshes the notifications cache.

Closes #361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Important Higher priority or release blocker
Development

Successfully merging a pull request may close this issue.

3 participants