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

Define constants for Channel IDs #1100

Closed
carlosscastro opened this issue Aug 2, 2019 · 6 comments · Fixed by #1757
Closed

Define constants for Channel IDs #1100

carlosscastro opened this issue Aug 2, 2019 · 6 comments · Fixed by #1757
Assignees
Labels
P2 Nice to have R8 Release 8 - March 16th, 2020
Milestone

Comments

@carlosscastro
Copy link
Member

In dotnet we have centralized constants for channel ids here. However, in Javascript there are channel id constants defined within the choice prompt classes, but they are used in nearby classes and I found occurrences of the string literals for channel ids.

We have new adapters for new channels coming and each one has a const for the channelId, it may be better to have this in BotBuilder.Connector to avoid future collisions but I'm not 100% sure.

The alternative would be to have each new channel adapter expose a const with the channelId they handle so we don't have to modify the product when we add new channels, but we probably need to agree on where a dev would expect to find this definition so we are consistent across the board.

If we go with the alternative, devs would have two places for ChannelId (Connector and the adapter), which may be confusing I am more inclined to have it in a single place for consistency.

@stevengum
Copy link
Member

As I mentioned internally, we should duplicate the constants in the connector and keep the current location in botbuilder-dialogs. We can't add a botframework-connector dependency in botbuilder-dialogs because that would introduce Node.js dependencies in a browser-compatible library.

To maintain consistency between the two, we can add Azure DevOps Pipeline Task to verify that the channelIds are the same in the two files.

P.S. I'm all for a single source of truth, but I don't think we can have a single source in this scenario.

@v-kydela
Copy link
Contributor

The C# channel constants used to be in a nested class called Channel.Channels but then they were moved to just Channels (still in the same package). Perhaps it would be best to move them again to a more centralized shared location like the Bot Framework Schema package.

@stevengum
Copy link
Member

If we move it to the schema package, it's accessible by all packages, even though the libraries used in the context of the browser should theoretically not need the channelIds. This works for me 👍

@stevengum
Copy link
Member

New issue filed for this: #1354

We could add the constants to botbuilder-core....

@v-kydela
Copy link
Contributor

@carlosscastro
@stevengum

Are there any plans to fix this?

@stevengum
Copy link
Member

This is not tied to any milestone currently so it hasn't been up for discussion. I'm going to assign it to R8 for now to get it into triaging discussion.

@stevengum stevengum added the R8 Release 8 - March 16th, 2020 label Nov 22, 2019
@carlosscastro carlosscastro self-assigned this Feb 10, 2020
@cleemullins cleemullins assigned Zerryth and unassigned carlosscastro Feb 13, 2020
@cleemullins cleemullins added the P2 Nice to have label Feb 18, 2020
@munozemilio munozemilio added this to the R8 milestone Jul 1, 2020
@github-actions github-actions bot added the here label Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Nice to have R8 Release 8 - March 16th, 2020
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants