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(common): calling Date Sorting multiple times was shuffling other lines #831

Merged
merged 1 commit into from
Dec 3, 2022

Conversation

ghiscoding
Copy link
Owner

@ghiscoding ghiscoding commented Dec 2, 2022

  • fixes bug mentioned in this Stack Overflow question, opened an Angular-Slickgrid issue for this as well.
  • for example if we had 10 lines with null values and 90 lines of valid dates, and we were sorting ascending multiple times, the dates were sorted correctly but the 10 null date lines were constantly being shuffled

Note

Note that the new code is taking slightly more time to execute because we now create a temp dates to sort nullish values, however it seems negligeable 1240ms vs 1125ms on first sort of 50k unsorted rows (so about 100-150ms longer).

image

- fixed bug mentioned in Stack Overflow: [question](https://stackoverflow.com/questions/74657131/slickgrid-header-menu-sorting-is-not-working-properly)
- for example if we had 10 lines with null values and 90 lines of valid dates, and we were sorting ascending multiple times, the dates were sorted correctly but the 10 null date lines were constantly being shuffled
@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #831 (987f7a0) into master (3e9f330) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master      #831   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          239       239           
  Lines        16366     16367    +1     
  Branches      5778      5777    -1     
=========================================
+ Hits         16366     16367    +1     
Impacted Files Coverage Δ
packages/common/src/sortComparers/dateUtilities.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@ghiscoding ghiscoding changed the title fix(common): Date Sorting was shuffling other lines with same dates fix(common): calling Date Sorting multiple times is shuffling and impacting other lines Dec 2, 2022
@ghiscoding ghiscoding changed the title fix(common): calling Date Sorting multiple times is shuffling and impacting other lines fix(common): calling Date Sorting multiple times was shuffling other lines Dec 2, 2022
@ghiscoding ghiscoding merged commit db34213 into master Dec 3, 2022
@ghiscoding ghiscoding deleted the bugfix/date-sorting branch December 3, 2022 19:34
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.

1 participant