-
Notifications
You must be signed in to change notification settings - Fork 89
feat(bulk-import): smart polling for import task status updates #2177
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
feat(bulk-import): smart polling for import task status updates #2177
Conversation
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
|
|
/cc @christoph-jerolimov @ShiranHi PTAL. |
|
/cc @lokanandaprabhu |
lokanandaprabhu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
christoph-jerolimov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want block this, but I have two small questions:
| // If exactly at boundary, wait full interval; otherwise wait until next boundary | ||
| return remainder === 0 ? intervalMs : intervalMs - remainder; | ||
| }, | ||
| refetchOnWindowFocus: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this feature make sense to keep on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christoph-jerolimov Since we're already polling every 60 seconds (or 10 seconds for active tasks), an additional API call on window focus would be redundant. The polling ensures data stays fresh, so disabling refetchOnWindowFocus reduces unnecessary API calls without impacting the user experience.
| // Calculate time until next 60-second aligned interval | ||
| const elapsed = Date.now() - startTimeRef.current; | ||
| const intervalMs = 60000; | ||
| const remainder = elapsed % intervalMs; | ||
| // If exactly at boundary, wait full interval; otherwise wait until next boundary | ||
| return remainder === 0 ? intervalMs : intervalMs - remainder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you do any fetch non active jobs? A failed job will be also failed a minute later, or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@christoph-jerolimov A repository's status can change externally - another team member could re-import a previously failed repo, or a new import could be triggered. Polling at 60s ensures we reflect the current state even for repos that weren't actively being imported by the current user.
|
This is a much better UX. Thanks @its-mitesh-kumar 👍 |
|
Maybe you can answer my questions anyway but I think this is a big improvement already. Thanks for this 👍 |



Description
Implements dynamic polling for import task status in the bulk import repository table. This provides real-time feedback during active imports while reducing API load for idle repositories.
Changes
refetchOnWindowFocus: falseto prevent unnecessary API calls on tab focusHow it works
The
refetchIntervalis now a function that:Fixes
UI after changes
Screen.Recording.2026-01-27.at.5.23.35.PM.mov