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

fixing infinity loop bug in date range #2798

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

T1m3M
Copy link
Contributor

@T1m3M T1m3M commented Apr 12, 2023

  • The PR is against the development branch
  • Does NOT modify files under the "dist" folder.
  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...). If this is a fix, please tag a bug.
    Bug fix.

  • What is the current behavior? (You can also link to an open issue here)
    When dealing with date range and selecting the same date as start/end date it causes an infinite loop and browser crash.

  • What is the new behavior (if this is a feature change)?
    As the problem was because of assuming that end date is always after start date, the start date was being incremented by 1 day before the for loop compare with the end date happens, causing the start date to be after the end date if it was the same day, hence the infinity loop.

The fix separates the increment from the initialization of the start variable and comparing if it's the same before the increment step and the for loop.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
    No

@Eonasdan
Copy link
Owner

Hello. Thanks for this. Someone already fixed this in another PR. I just need to push a new version.

@Eonasdan Eonasdan closed this Apr 12, 2023
@T1m3M
Copy link
Contributor Author

T1m3M commented Apr 12, 2023

I took a look just now at the other bug fix
I guess it just prevents picking the same day, that's not my use case of using the date range as a filter because I want to be able to pick the same day with different time (or even same time to filter a specific point in time).

@Eonasdan Eonasdan reopened this Apr 14, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@Eonasdan Eonasdan merged commit 6386cf9 into Eonasdan:development Apr 20, 2023
Eonasdan added a commit that referenced this pull request Apr 22, 2023
* Fix #2788 (#2790)

Break if current range-start is clicked to prevent infinite loop

* adding placement option (#2789)

* fixes #2785 (#2797)

* fixes #2785
fixes #2783
fixes #2768
improves docs flow

* fixed plugin/locale missing type defs

* 2791 more tests (#2800)

* validation tests
* update datetime tests
* "dates" tests
* actions tests

* fixing infinity loop bug in date range (#2798)

* Improvements (#2801)

* fixes #2795
* fixes #2784
* fixes #2687
* fixes #2786
* resolves #2764 
* fix repl cdn links
* fix date range bug

* version 6.7.7

* version 6.7.7

---------

Co-authored-by: iTzVirtual_ <[email protected]>
Co-authored-by: Killian Hale <[email protected]>
Co-authored-by: GitHub User <[email protected]>
@Eonasdan
Copy link
Owner

This was released with 6.7.7

Eonasdan added a commit that referenced this pull request May 22, 2023
* Fix #2788 (#2790)

Break if current range-start is clicked to prevent infinite loop

* adding placement option (#2789)

* fixes #2785 (#2797)

* fixes #2785
fixes #2783
fixes #2768
improves docs flow

* fixed plugin/locale missing type defs

* 2791 more tests (#2800)

* validation tests
* update datetime tests
* "dates" tests
* actions tests

* fixing infinity loop bug in date range (#2798)

* Improvements (#2801)

* fixes #2795
* fixes #2784
* fixes #2687
* fixes #2786
* resolves #2764
* fix repl cdn links
* fix date range bug

* version 6.7.7

* version 6.7.7

---------

Co-authored-by: iTzVirtual_ <[email protected]>
Co-authored-by: Killian Hale <[email protected]>
Co-authored-by: GitHub User <[email protected]>
Eonasdan added a commit that referenced this pull request Jul 3, 2023
* Fix #2788 (#2790)

Break if current range-start is clicked to prevent infinite loop

* adding placement option (#2789)

* fixes #2785 (#2797)

* fixes #2785
fixes #2783
fixes #2768
improves docs flow

* fixed plugin/locale missing type defs

* 2791 more tests (#2800)

* validation tests
* update datetime tests
* "dates" tests
* actions tests

* fixing infinity loop bug in date range (#2798)

* Improvements (#2801)

* fixes #2795
* fixes #2784
* fixes #2687
* fixes #2786
* resolves #2764
* fix repl cdn links
* fix date range bug

* version 6.7.7

* version 6.7.7

---------

Co-authored-by: iTzVirtual_ <[email protected]>
Co-authored-by: Killian Hale <[email protected]>
Co-authored-by: GitHub User <[email protected]>
Eonasdan pushed a commit that referenced this pull request Jul 3, 2023
Eonasdan pushed a commit that referenced this pull request Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants