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

Fix: Update asc / desc reachability sorting #970

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Conversation

ckbedwell
Copy link
Contributor

Problem

We had a bug reported internally in Slack that our reachability Asc / Desc. were reporting the wrong way round.

Solution

This PR switches the order of Asc / Desc. As I was fixing this I noticed that undefined and other falsey values of reachability were given a value of 101 so put them above 100% (which I think is what led to this bug implementation in the first place).

I noticed as I was fixing it that the code could be much more performant and use less CPU cycles, too 😄

Before
The checks list page with ascending reachability. The checks show 0, N/A, 0, 100, 100 for their reachability values.
The checks list page with descending reachability. The checks show 48.5, 59.8, 98.6, 100, 100 for their reachability values.

After

The checks list page with ascending reachability. The checks show N/A, 48.5, 59.6  for their reachability values.
The checks list page with ascending reachability. The checks show 100, 100, 100, 100, 100 for their reachability values.

@ckbedwell ckbedwell requested review from w1kman and VikaCep October 11, 2024 10:46
@ckbedwell ckbedwell requested a review from a team as a code owner October 11, 2024 10:46
Copy link
Contributor

@VikaCep VikaCep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 💯 💯

Copy link
Contributor

@w1kman w1kman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👌🏻

@ckbedwell ckbedwell merged commit c281b77 into main Oct 15, 2024
5 checks passed
@ckbedwell ckbedwell deleted the fix/asc-desc-reverse branch October 15, 2024 12:20
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.

3 participants