fix: Compare location by id then long rather than just long - #844
Merged
Conversation
RyanYensch
added a commit
that referenced
this pull request
Aug 2, 2026
* 824 unable to select time all rooms page (#827) * changed value to defaultValue to fix bug with not being able to select time on all rooms page * added unit test * removed comment * fixed linting errors * fix: Compare location by id then long rather than just long (#844) * fix: Compare location by id then long rather than just long * fix: linting issues --------- Co-authored-by: Joshua Pozzolungo <jpozzolungo2@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Sorted the lower-to-upper campus by building ID, then by longitude, then by name, rather than just longitude.
Why
There are 3 buildings for which we do not have the location data but do have the ID for, so it was comparing by 0 and placing those buildings in the wrong location.
How
Got the ID for the room (e.g. K-D17 becomes 17) and used that as the main comparator; if they have the same ID, it then uses the longitude to determine which is higher/lower; if somehow they are identical, it then does it alphabetically for the building name.
Key checks:
Manual tests:
Screenshot / Recording
Before (prod)
Lower sort
Upper sort
After
Lower Sort
Upper sort
Upper Sort