Skip to content

fix(editor): Keep CSV imports tied to the selected file - #37906

Open
Suzu1Dev wants to merge 1 commit into
n8n-io:masterfrom
Suzu1Dev:fix/csv-import-selection
Open

fix(editor): Keep CSV imports tied to the selected file#37906
Suzu1Dev wants to merge 1 commit into
n8n-io:masterfrom
Suzu1Dev:fix/csv-import-selection

Conversation

@Suzu1Dev

@Suzu1Dev Suzu1Dev commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Replacing a CSV in the data-table import dialog can leave the previous upload ID active. Import can then send the old file ID while the dialog displays the new file's name. An older upload that finishes last can cause the same result after both uploads complete.

Clear completed upload metadata when a new upload starts. Disable Import until the current upload is ready. Reuse useLatestFetch to guard upload results, errors, and loading cleanup. Invalidate pending uploads when the dialog resets or the component unmounts.

Codex assisted with the implementation, regression tests, and draft text.

How to test

From packages/frontend/editor-ui, run:

pnpm test src/features/core/dataTable/components/ImportCsvModal.test.ts src/app/composables/useLatestFetch.test.ts
pnpm lint
pnpm typecheck

The component tests use the real upload control and deferred API responses. They cover file replacement, reversed response order, old errors, loading state, dialog reset, unmount, and files with the same name. The import assertion checks the current file ID sent to the store action.

For manual verification, use an existing data table with name and age columns. Upload A.csv, then replace it with B.csv while delaying B's response. Import must stay disabled until B is ready. Complete B before A in a separate run. Import must still use B after both responses arrive.

Automated validation uses a rendered test DOM and mocked API actions. No live browser, backend, or database was used. See the linked issue for sample CSV contents and detailed steps.

Validation results:

  • Base revision 33eb5c196e0ce3a2c71525929a4ef861cb94b168 with the regression tests: 10 failed and 9 passed. The failures reproduce the enabled Import button and the old file ID.
  • Fixed revision: 19 passed. This includes 15 component tests and 4 existing helper tests.
  • Editor lint and typecheck: passed.
  • Repository lint and typecheck: passed. The run for the other packages completed all 208 tasks, including dependency builds. The editor checks ran separately.
  • Repository style lint: passed. All 7 tasks completed.
  • Biome, Prettier, and Git whitespace checks: passed.

The full repository test suite was not run.

Related Linear tickets, Github issues, and Community forum posts

Fixes #37905

https://linear.app/n8n/issue/GHC-9419

Review / Merge checklist

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

🤖 PR Summary generated by AI

Review in cubic

@Suzu1Dev
Suzu1Dev marked this pull request as ready for review September 5, 2026 07:24

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would not auto-approve. Auto-approval skipped because this PR is from an external contributor.

Re-trigger cubic

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-05T07:26:33.628227Z 4eb65a1 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@n8n-assistant n8n-assistant Bot added community Authored by a community member triage:pending Waiting to be triaged labels Sep 5, 2026
@n8n-assistant

n8n-assistant Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Hey @Suzu1Dev,

Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request.

Before we can proceed, please ensure the following: • Your PR references the GitHub issue it fixes (or, for feature requests, a link to the corresponding community forum post). • Tests are included for any new functionality, logic changes or bug fixes. • The PR aligns with our contribution guidelines.

Why the linked issue matters: Our teams pick up work from the issue, not from individual pull requests — the issue is what reaches them, with your PR linked to it. So please make sure the issue contains everything needed to judge the change: a clear problem description, reproduction steps, and the expected behaviour. If the issue is thin, add the missing context there rather than only in the PR description.

Regarding new nodes: We no longer accept new nodes directly into the core codebase. Instead, we encourage contributors to follow our Community Node Submission Guide to publish nodes independently.

If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach.

About review timelines: While we plan to review it as soon as possible, we are currently unable to provide an exact timeframe. Our goal is to begin reviews within a month, but this may change depending on team priorities. We will reach out when the review begins.

Please also note that other contributors may have opened pull requests for the same issue. We keep them all open so the reviewing team can choose the approach that fits best. Once the issue is resolved, the remaining pull requests are closed — this is not a judgement on the quality of your work, and we're grateful for it either way.

Thank you again for contributing to n8n.

@n8n-assistant n8n-assistant Bot added triage:in-progress Triage is in progress bug triage:complete Triage has been completed and issue is ready for internal teams triage:ready-for-review and removed triage:pending Waiting to be triaged triage:in-progress Triage is in progress bug labels Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed community Authored by a community member triage:complete Triage has been completed and issue is ready for internal teams triage:ready-for-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replacing a CSV file can import the previously selected file

1 participant