Skip to content

fix: remove outdated import/export jobs#6080

Merged
camiloHimura merged 2 commits intodevelopfrom
ccolora11/5919-import-errors
Apr 16, 2026
Merged

fix: remove outdated import/export jobs#6080
camiloHimura merged 2 commits intodevelopfrom
ccolora11/5919-import-errors

Conversation

@camiloHimura
Copy link
Copy Markdown
Contributor

Summary

closes #5919

This PR removes import/export LS job entries when the ID is no longer valid.

How to test

Checklist

  • The PR title and description are clear and descriptive
  • I have manually tested the changes
  • All changes are covered by automated tests
  • All related issues are linked to this PR (if applicable)
  • Documentation has been updated (if applicable)

@camiloHimura camiloHimura requested a review from a team as a code owner April 10, 2026 20:12
Copilot AI review requested due to automatic review settings April 10, 2026 20:12
@camiloHimura camiloHimura added the Geti UI Issues related to Geti application frontend label Apr 10, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

🐳 Docker image sizes

Device Size
cpu 3604.1 MB (3.52 GB)
xpu 10572.7 MB (10.32 GB)
cuda 10219.1 MB (9.98 GB)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes stale dataset import tracking entries (stored client-side) when the referenced backend job no longer exists, addressing “old import messages reappearing” scenarios (Issue #5919).

Changes:

  • Extend useImportJobStatus’s onError callback to receive the underlying error object.
  • In LoadingImportDataset, delete the local import entry when the job query fails with an “invalid job” error.
  • Update LoadingImportDataset tests to reflect the new “delete entry on invalid job” behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
application/ui/src/hooks/api/jobs/use-import-job-status.hook.tsx Passes error object into onError and adjusts effect deps around error handling.
application/ui/src/components/loading-import-dataset/loading-import-dataset.component.tsx Deletes stale import entries on invalid job errors; refactors success flow around staged-dataset deletion.
application/ui/src/components/loading-import-dataset/loading-import-dataset.test.tsx Updates assertions to expect entry deletion on invalid job query failures and renames tests for clarity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread application/ui/src/hooks/api/jobs/use-import-job-status.hook.tsx Outdated
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 10, 2026

📊 Test coverage report

Metric Coverage
Lines 57.5%
Functions 79.1%
Branches 88.0%
Statements 57.5%

};

it('renders failed job state and displays job message and error', async () => {
it('displays job message, error, and does not delete entry when job fails', async () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why we don't remove the entry (staged-file) when import job fails? When that entry is removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The requirement is to remove it when the job is invalid (line 95). For any other errors, we should display the error information so the user knows what happened. When they manually close the card, the staged file is removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I understand that but the question is why we don't remove the entry (staged-file) when import job fails?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To avoid having the local storage entry point to a staged file that no longer exists, it could be removed when an error occurs. However, I think it should remain until all of its references have been cleared.

@camiloHimura camiloHimura force-pushed the ccolora11/5919-import-errors branch from cb6260a to 377c2ef Compare April 14, 2026 15:46
@camiloHimura camiloHimura force-pushed the ccolora11/5919-import-errors branch from 377c2ef to 134c226 Compare April 15, 2026 14:28
});
},
onError: (error) => {
if (isInvalidJob(error)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if we're doing it onError and onsuccess, can we not do it on onSettled?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It’s possible, but I’d prefer not to. Under the hood, we’re using useEffect to trigger those events, and I want to avoid adding more than strictly necessary.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i meant using onSettled: () => {
...the 2 lines that are repeated
}

wont it work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, but we’d also need to add an extra event and additional validation, since deleteEntry and deleteStagedFileMutation.mutate are not called for every error

@camiloHimura camiloHimura added this pull request to the merge queue Apr 16, 2026
Merged via the queue into develop with commit ee739ae Apr 16, 2026
33 checks passed
@camiloHimura camiloHimura deleted the ccolora11/5919-import-errors branch April 16, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Geti UI Issues related to Geti application frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset import messages surprise on the projects page

4 participants