Skip to content

Fix rosé catalogue wines stuck as RED after 1.0.x upgrade - #41

Open
T0liver wants to merge 1 commit into
mainfrom
c-fix-rose-colour-repair-6d97
Open

T0liver wants to merge 1 commit into
mainfrom
c-fix-rose-colour-repair-6d97

Conversation

@T0liver

@T0liver T0liver commented Nov 29, 2026

Copy link
Copy Markdown
Owner

Fixes #36

Approach

After the existing INSERT … IGNORE catalog import (full web, delta added, and file), we run a targeted Room UPDATE for incoming catalogue wines whose parsed colour is ROSE: set colour = 'ROSE' only where the row already has colour = 'RED' (the 1.0.x toWineColour() fallback). Producer, year, tastings, and other user edits are untouched. User-chosen colours other than this RED fallback (e.g. WHITE) are not changed.

Repair is wired in WineRepositoryImpl.insertAll(…, fromCatalog = true) so all three import paths share one implementation.

Limits

  • Only corrects RED → ROSE for wines present in the incoming batch with catalogue colour rosé; it does not fix other mis-mappings.
  • If a user intentionally set a true rosé wine to RED, a subsequent catalogue import will set it back to ROSE (same ambiguity as the original fallback—no catalogue snapshot in a migration).
  • Does not alter delta updated rows (those still go through updateAll as before).

Tests

  • Unit: WineRepositoryImplCatalogImportTest — repair invoked for rosé catalogue ids only when fromCatalog = true.
  • Instrumented: CatalogRoseColourRepairTest — RED fallback repaired to ROSE; tastings and user-edited fields preserved; non-RED stored colours and catalogue-red wines unchanged.
Open in Web Open in Cursor 

During catalogue import, repair rows that still store the 1.0.x RED
fallback when the incoming catalogue wine is rosé, without touching
other columns or non-RED user colours.

Co-authored-by: T0liver <T0liver@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

Test Results

21 tests  +2   21 ✅ +2   2s ⏱️ -1s
 6 suites +1    0 💤 ±0 
 6 files   +1    0 ❌ ±0 

Results for commit b36cf17. ± Comparison against base commit e7ecd3a.

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.

[Automated test] Upgrade from 1.0.x: "Rosé kettesben" stays Red after re-import (Found by automated testing, Release Tester, v1.1.0)

2 participants