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(ui): properly debounce/abort logs search #3412

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

bodinsamuel
Copy link
Collaborator

Changes

Fixes https://linear.app/nango/issue/NAN-2629/date-filter-issue-when-selecting-past-dates

Screenshot 2025-01-30 at 14 41 03

  • Properly debounce/abort logs search
    When you start selecting a day in the date picker it triggers an initial search that would be done by the time you finished picking the end day of your date range. Which then triggered a second query but with the previous invalid data not being removed.
    I had bad cancellation/concurrency strategies:
  • with the isLoading debounce which was not triggering some search = not aborting and not fetching
  • the signal was passed as reference which could be replaced by another signal controller before being checked

🧪 Tests

  • Go to UI
  • Pick a first day, try to wait 100-200ms before clicking another day (it's not that simple though)
  • At the end you should have proper data
    e.g: have the last 2 days picked, start clicking Jan 22, wait, then click Jan 23 as the end day. You should not see Jan 30 as the last operation

@bodinsamuel bodinsamuel self-assigned this Jan 30, 2025
Copy link

linear bot commented Jan 30, 2025

@bodinsamuel bodinsamuel requested a review from a team January 30, 2025 13:46
Copy link
Contributor

@nalanj nalanj left a comment

Choose a reason for hiding this comment

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

🍻

@bodinsamuel bodinsamuel enabled auto-merge (squash) January 30, 2025 15:58
@bodinsamuel bodinsamuel merged commit 64805ae into master Jan 30, 2025
17 checks passed
@bodinsamuel bodinsamuel deleted the sam/25_01_30/fix/ui-debounce-abort branch January 30, 2025 16:04
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