Skip to content

Comments

[ENGG-5312] fix: Fix import for records with duplicate names#290

Open
ajinkya-browserstack wants to merge 3 commits intomasterfrom
ENGG-5312-fix-import
Open

[ENGG-5312] fix: Fix import for records with duplicate names#290
ajinkya-browserstack wants to merge 3 commits intomasterfrom
ENGG-5312-fix-import

Conversation

@ajinkya-browserstack
Copy link
Contributor

@ajinkya-browserstack ajinkya-browserstack commented Feb 13, 2026

Case comparison for baseName: "Untitled request" (hardcoded) vs baseName: sanitizedName:

Case 1: baseName hardcoded to Untitled request

  • Only names that look like Untitled request, Untitled request1, etc. get auto-renamed.
  • Untitled request → Untitled request1 works.
  • Login when Login already exists does not become Login1; it fails with Record already exists.
  • Untitled Request (different case) when Untitled request exists also fails with Record already exists.

Case 2: baseName set to sanitizedName

  • We always use the actual sanitized name as the base for conflicts.
  • Untitled request still becomes Untitled request1, Untitled request2, etc.
  • Login when Login exists becomes Login1, then Login2, etc.
  • My: API? when sanitized to My_ API_ and My_ API_ exists becomes My_ API_1.
  • Untitled Request when Untitled request exists becomes Untitled Request1 instead of failing.

Summary by CodeRabbit

  • Bug Fixes

    • Name conflict detection now ignores letter-case, preventing duplicate names that differ only by capitalization when creating records, environments, and collections.
  • Refactor

    • Consolidated and standardized name sanitization and conflict-resolution behavior across creation workflows for more consistent naming and fewer edge-case collisions.

@linear
Copy link

linear bot commented Feb 13, 2026

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ed1976e and 6fc610e.

📒 Files selected for processing (1)
  • src/renderer/actions/local-sync/common-utils.ts

Walkthrough

The PR makes name conflict checking case-insensitive and consolidates sanitization when creating entities. In src/renderer/actions/local-sync/common-utils.ts, isNewEntityName now uses case-insensitive regex matching and getAlternateName compares names using lowercase while preserving returned casing. In src/renderer/actions/local-sync/fs-manager.ts, sanitization is computed once and reused for quick-create and import flows in createRecord, createEnvironment, and createCollectionFromCompleteRecord, removing duplicate paths and hard-coded defaults.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • iostreamer-X
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and accurately describes the main change: fixing import handling for records with duplicate names by implementing case-insensitive name matching and proper conflict resolution.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ENGG-5312-fix-import

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nsrCodes nsrCodes removed their request for review February 23, 2026 16:03
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