Skip to content

Change getPorts to resolve all responses via promises to resolve race condition #195

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

Merged
merged 5 commits into from
May 8, 2025

Conversation

rikkuness
Copy link
Contributor

Hopefully fixes #194

@gfwilliams
Copy link
Member

Looks good, but it looks like:

          ports.sort(function(a,b) {
            if (a.unimportant && !b.unimportant) return 1;
            if (b.unimportant && !a.unimportant) return -1;
            return 0;
          });

got removed, or did you handle it somewhere else I missed? I think the unimportant thing is so the CLI can automatically connect to the correct device (it's not considering ones that probably aren't right).

@rikkuness
Copy link
Contributor Author

good spot, I think I missed that, I'll fix now

@gfwilliams
Copy link
Member

Great, thanks! Just merging

@gfwilliams gfwilliams merged commit 2b601e0 into espruino:master May 8, 2025
1 check passed
@rikkuness rikkuness deleted the getPortsPromises branch May 9, 2025 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Espruino.Core.Serial.getPorts can callback too early
2 participants