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

Infinit loop with more than 255 services #928

Closed
cleemullins opened this issue May 16, 2019 · 0 comments · Fixed by #998
Closed

Infinit loop with more than 255 services #928

cleemullins opened this issue May 16, 2019 · 0 comments · Fixed by #998
Assignees
Labels
4.5 P1 Painful if we don't fix, won't block releasing

Comments

@cleemullins
Copy link
Contributor

cleemullins commented May 16, 2019

In the BotConfigurationBase class, the following code is present:

       let found = false;
        do {
            found = false;
            service.id = Math.floor((Math.random() * 255)).toString();
            for (const existingService of this.services) {
                if (existingService.id === service.id) {
                    found = true;
                    break;
                }
            }
	} while (found);

Problem 1:
This code results in an infinite loop if 255 or more services are specified.

Problem 2:
This code DOES NOT check to see if the Service exists the way the C# code does. Sync with @tomlm to figure out the "Why?" of this behavior, along with the reason for the ID Reassignment.

This is similar to C# Bug:
microsoft/botbuilder-dotnet#1910

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.5 P1 Painful if we don't fix, won't block releasing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants