Skip to content

Sort openPorts and failedPorts before returning#146

Merged
lissy93 merged 1 commit into
lissy93:masterfrom
n0a:patch-3
May 28, 2024
Merged

Sort openPorts and failedPorts before returning#146
lissy93 merged 1 commit into
lissy93:masterfrom
n0a:patch-3

Conversation

@n0a
Copy link
Copy Markdown
Contributor

@n0a n0a commented May 28, 2024

This commit addresses an issue where the order of ports in the scan results (openPorts and failedPorts) appeared random due to the asynchronous nature of the port checking process.

Problem:
The port scanning process involves checking multiple ports asynchronously. As a result, ports are added to the openPorts and failedPorts arrays in the order in which the checks complete, rather than in numerical order. This leads to an unpredictable and unsorted list of ports in the final results.

Solution:
To ensure consistency and readability, the arrays openPorts and failedPorts are now explicitly sorted in ascending numerical order before being returned. This sorting is done after all port checks are complete, ensuring that the final output is always in a predictable, ordered format.

Changes:

  • Added sorting of openPorts and failedPorts arrays before returning the results.
  • Ensured that ports not checked due to a timeout are also added to the failedPorts array in a sorted manner.

These changes improve the readability and usability of the scan results, making it easier for users to interpret the output.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2024

βœ… Deploy Preview for web-check ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit b55a1cc
πŸ” Latest deploy log https://app.netlify.com/sites/web-check/deploys/66551f51b942620008047efb
😎 Deploy Preview https://deploy-preview-146--web-check.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lissy93 lissy93 merged commit 5b71ba9 into lissy93:master May 28, 2024
aristech pushed a commit to aristech/web-check that referenced this pull request Jan 7, 2026
Sort openPorts and failedPorts before returning
SmartMur pushed a commit to SmartMur/web-check that referenced this pull request Apr 5, 2026
Sort openPorts and failedPorts before returning
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.

2 participants