mattermost / mattermost-plugin-legal-hold

Plugin to create and manage legal holds in Mattermost
Other
5 stars 2 forks source link

Legal hold job is recreated on any server config change #45

Open mickmister opened 1 month ago

mickmister commented 1 month ago

This plugin makes an assumption that the RPC hook OnConfigurationChange is called only when this plugin's settings have changed, but it's called when any server config value is changed. The plugin creates a new legal hold job when this occurs.

The plugin should instead verify that one of its own plugin settings was changed in the process and then reconfigure itself.


https://github.com/mattermost/mattermost-plugin-legal-hold/blob/61943a3e202d4ada2a89a30ccd2551bb7f8a9702/server/plugin.go#L127

https://github.com/mattermost/mattermost-plugin-legal-hold/blob/61943a3e202d4ada2a89a30ccd2551bb7f8a9702/server/plugin.go#L172-L179

mickmister commented 1 month ago

A PR was raised to address this https://github.com/mattermost/mattermost-plugin-legal-hold/pull/47, but it may not be the right solution for the core concern here. The focus on this task should be on verifying the behavior of reconfiguring the job on config change, and ensure that it's resilient to being called potentially often.