mattermost-community / mattermost-plugin-autolink

Automatically rewrite text matching a regular expression into a markdown link.
Apache License 2.0
131 stars 57 forks source link

Fix Autolink admin config parsing #184

Closed hanzei closed 2 years ago

hanzei commented 2 years ago

Summary

The plugin was falsely storing it's config in UperCase names, which lead to the webapp not being able to rea

This PR make use of json.Marshal to convert the plugin config to an map[string]Interface{} and hence json tags are used everywhere now.

There is one migration left. If an admin (after updating to this PR) sees the empty list in the system console and inputs something, the existing admin list will be overwritten. Running /autolink add or /autolink delete brings the configuration in the right state again.

Ticket Link

https://github.com/mattermost/mattermost-plugin-autolink/issues/180 https://github.com/mattermost/mattermost-plugin-autolink/issues/181

hanzei commented 2 years ago

@dipak-demansol gentle reminder to review this PR

dipak-demansol commented 2 years ago

@dipak-demansol gentle reminder to review this PR

@hanzei @DHaussermann i'm not able to regenerate the 180 & 181 issue with the master Build. Its working fine with the master build.

hanzei commented 2 years ago

@dipak-demansol Did you test with a clean plugin config i.e. PluginSettings.Plugins.mattermost-autolink is empty?

dipak-demansol commented 2 years ago

@dipak-demansol Did you test with a clean plugin config i.e. PluginSettings.Plugins.mattermost-autolink is empty?

Yes

hanzei commented 2 years ago

@dipak-demansol Could you please test with the following steps:

  1. Set an autolink admin via the system console
  2. Run /autolink add foo to create an link
  3. Check the list of autolink admins in the system console

Observed behaviour on master: The list is empty

Expected behaviour: The list contains the admins set in step 1