mattermost-community / mattermost-plugin-custom-attributes

Mattermost plugin for adding custom attributes to users!
Apache License 2.0
46 stars 23 forks source link

fix issues with using an outdated redux package #69

Closed coltoneshaw closed 3 years ago

coltoneshaw commented 3 years ago

Summary

fixes #68 - Fix to resolve the outdated redux package. Specifically for searchTeams. Tested locally and there are no errors.

The plugin is currently built to take searchTeams(term, options) however the version of redux 5.26 doesn't take that. It looks like previously it took export function searchTeams(term: string, page?: number, perPage?: number) https://github.com/mattermost/mattermost-redux/commit/106c35967b1a92140fc86dfb442d88520c070643

5.33 redux searchTeams - https://github.com/mattermost/mattermost-redux/blob/3d1028034d7677adfda58e91b9a5dcaf1bc0ff99/src/actions/teams.ts#L142

Recreate

  1. Git clone the current repo
  2. run make dist
  3. Upload the plugin to your server
  4. Attempt to search teams and you'll see the 404 error
coltoneshaw commented 3 years ago

Screen Shot 2021-07-16 at 2 00 42 PM

This is before the redux package is updated you'll see this error in the console.

coltoneshaw commented 3 years ago

Sorry, didn't realize re-naming my branch closed this PR.

mickmister commented 3 years ago

Thanks @coltoneshaw :+1:

Do you mind running npm install in the webapp directory of the plugin, and pushing the changes that get applied to the package-lock.json file?

coltoneshaw commented 3 years ago

@mickmister - Done! Let me know how that looks.

mickmister commented 3 years ago

@coltoneshaw Did you happen to run npm i with an npm version >= 7? If this is the case, can you actually revert the package-lock changes, and re-run the npm i command with a npm version less than 7? We want to convert the plugins to use the newer version of npm in one effort, and this may complicate things with the logistics of the effort. You can toggle the npm version you are using locally using nvm

coltoneshaw commented 3 years ago
coltonshaw@Coltons-MacBook-Pro mattermost-plugin-custom-attributes-1.3.0 % npm -v
7.6.0
coltonshaw@Coltons-MacBook-Pro mattermost-plugin-custom-attributes-1.3.0 % 

@mickmister - I did, didn't realize that would cause an issue here. Do you have a specific version you'd like to see used?

mickmister commented 3 years ago

Actually this should be fine as long as the plugin compiles correctly with npm 7, which it does since you verified the fix works with this change

coltoneshaw commented 3 years ago

It works in the releases v1.3, but since then I believe the package dependencies for redux changed and caused it to break. I believe this was slotted for v1.4. The current repo will error on team search, but the released version works fine.

hmhealey commented 3 years ago

Yeah, that's expected from that I've seen. The new format stores a whole lot more information in it.

mickmister commented 3 years ago

@DHaussermann Test steps here should be to use the feature as shown in the PR description's screenshot, and verify the console error does not appear on this version. Light regression testing would be desired too.

dipak-demansol commented 3 years ago

@DHaussermann @mickmister i tested that and I'm not getting that error While Searching the Team, but in the search i got only 1 team name as Warrior9 and its my own team so is it right or there should be other team name visible on the search? here is the video of that.

https://user-images.githubusercontent.com/89907719/138099721-9eb69b42-d63c-4685-a1be-6ead110705cb.mp4