Skip to content

fix: import case-only duplicate homes instead of dropping them - #50

Merged
milanmalhotra merged 4 commits into
devfrom
issue-48-case-only-duplicate-homes
Aug 17, 2026
Merged

fix: import case-only duplicate homes instead of dropping them#50
milanmalhotra merged 4 commits into
devfrom
issue-48-case-only-duplicate-homes

Conversation

@milanmalhotra

@milanmalhotra milanmalhotra commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Closes #48

Problem

Set Homes v1 matched home names case sensitively, so one player could hold both base and Base. Home names here are unique per player ignoring case, so the importer treated the second one as an existing home and skipped it. Nothing named it, and the dry run did not show it at all, so an admin had no way to know a home was lost.

Change

  • The second of a case-only pair is imported under the next free numbered name (Base arrives as Base2). No home is dropped for a name clash.
  • The rename is written to the import report and, on confirm, to the server log, naming the player, the original name and the stored name.
  • The report summary gains a renamed count, and "skipped: name exists" is reworded to "skipped: already imported", which is what that path actually means now.
  • A per-player NameLedger in SetHomesV1Importer snapshots the names already in the database before that player's first import and tracks names taken during the run separately. That split is what makes the preview report the same numbers as the confirm that follows it, since a dry run writes nothing.
  • HomesDao.namesFor(UUID) added to back the ledger.
  • README migration section documents the behaviour, and a patch changeset is included.

Tests

mvn test: 317 tests, 0 failures, 0 skipped. New coverage in SetHomesV1ImporterTest (case-only pair kept with its own location, rename reported and logged, dry run and confirm agree, dry run writes nothing, genuine re-import renames nothing, disambiguated name itself taken later in the file or already in the database, unnamed home vs an existing default, both homes reachable by command), ImportReportTest and HomesDaoTest.

@milanmalhotra
milanmalhotra merged commit 1f933ff into dev Aug 17, 2026
3 checks passed
@milanmalhotra
milanmalhotra deleted the issue-48-case-only-duplicate-homes branch August 17, 2026 20:23
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