Skip to content

fix: prevent n8n backup collisions and repeated generated inputs - #17

Open
aolingge wants to merge 1 commit into
mainfrom
codex/n8n-backup-collision-20261010
Open

aolingge wants to merge 1 commit into
mainfrom
codex/n8n-backup-collision-20261010

Conversation

@aolingge

Copy link
Copy Markdown
Owner

Two source paths such as a/b.json and a__b.json currently map to one flattened backup file, silently losing a workflow. Generated metadata can also overwrite a workflow named README.md or backup-report.json, and repeated runs with a custom output directory can back up their own generated copies.

Preflight candidate destinations before creating or writing backups, reject filename/metadata collisions, exclude the resolved custom output directory from input, and refuse output at the repository root or an ancestor (including directory aliases). Compare destination names without case on every platform for portable backups; this deliberately also rejects case-only differences on case-sensitive filesystems. Preserve existing flattened names, redaction and report schema. Existing generated backups can still be refreshed; stale or source files are not deleted.

Validation: eight regression cases were observed failing before fixes, including three mixed-case regressions added for the final review finding. Actual Node 20.20.2 and 24.19.0 each pass all 44 tests; lint/typecheck/build, normal scan smoke and diff checks pass. Coverage includes repeated custom/absolute output, reserved metadata, alias-to-root and sibling-prefix boundaries. The non-Windows platform branch is simulated in portable-name tests; no physical macOS machine was tested. No real n8n workflow/API, credentials, dependencies, Actions or releases are involved.

This branch has not been deployed

No deployments
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.

1 participant