As discussed in https://github.com/pnp/office365-cli/pull/896#issuecomment-478964344 it would be a good idea to check the format of Teams channel IDs before calling the graph endpoints.
@waldekmastykarz suggested adding a validation method to the already existing utilities. We could validate the string provided for a leading "19:" and an ending "@thread.skype.com"
Idea is to provide a useful message if channel IDs are not correct.
My suggestion would be creating this central validation, use it in graph teams tab list and afterwards create an additional issue for updating the other commands. Is this ok with you @waldekmastykarz and @VelinGeorgiev? If so, I'm happy to take this on my todo list.
Nice suggestion @thomyg. I'd say, let's create a single issue for adding the logic and updating all necessary commands. Since this is a relatively small change, there is no need to create a separate issue for updating commands. Also, to double check we had all commands, let's include a checklist with all commands that should be updated.
My suggestion for the validation would be: ^19:[0-9a-zA-Z][email protected]$ As this checks for the leading and ending parts and allows digits and chars in between in whatever length.
The commands checklist would be:
If this is ok, I would update those commands with the above-mentioned validation by adding "isValidTeamsChannelId" in Utils.ts @waldekmastykarz and @VelinGeorgiev
Perfect! Please do @thomyg 馃憦
Unfortunately this validation is now broken, as Teams is now spitting out channel IDs that end with '@thread.tacv2'. Will create a new issue and PR for the fix.
Good catch! 馃憦
Most helpful comment
Unfortunately this validation is now broken, as Teams is now spitting out channel IDs that end with '@thread.tacv2'. Will create a new issue and PR for the fix.