intent checks: a soft duplicate warning is asked again on every update, even when its fields did not change

Aperta Adatta ai principianti
#8,568 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@NicoleNG18 ci sta già lavorando.

Dal 10/11/2026.

  • #234 di @NicoleNG18 — aperta
  • #8572 di @NicoleNG18 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend, databases

Direzione di ricerca

Inizia da template-application-dao-java/data/Repository.java.template, in particolare da warnings(...) e dal relativo ramo duplicate, poi confronta il suo comportamento di aggiornamento con requireUniqueIgnoringCase nello stesso template. Verifica come il repository distingue la creazione dall’aggiornamento e quali campi del controllo dei duplicati possono essere confrontati con la riga memorizzata. Il lavoro è completato quando è confermato che i duplicati soft confermati non generano un nuovo avviso se quei campi sono invariati, mentre le creazioni e gli aggiornamenti che li modificano continuano a essere controllati; l’issue non indica alcun file di test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

A soft duplicate check (intent checks: - { kind: duplicate, severity: warn }) asks again on every later update of a record whose duplicate was already confirmed, even when none of the checked fields changed.

Once two records with the same value exist on purpose (the person confirmed the warning when creating the second one), every save of either of them answers 428 with the same question, e.g. after changing only the price.

Steps to reproduce

Products module (Name carries a soft duplicate check):

  1. POST ProductController {"Name":"QA-DUP 1110","Type":1,"Price":10} → 200.
  2. POST ProductController {"Name":"qa-dup 1110","Type":1,"Price":10} → 428 "Вече съществува продукт с това име: QA-DUP 1110" (code Product.duplicate.9). This one is correct.
  3. Repeat with X-Confirm-Warnings: Product.duplicate.9 → 200, the second product is created.
  4. PUT ProductController/{id} of that product with only Price changed (10 → 11) → 428 again, the same duplicate warning.

Expected: 200. The name did not change, and the duplicate was already confirmed.

Cause

template-application-dao-java/data/Repository.java.template, warnings(...) (the duplicate branch, ~line 2027) looks for another record with the same (normalized) values on every write, create or update. It does not look at whether the checked fields changed. The twin still exists, so the check finds it on every update.

Suggested fix

On an update, run a duplicate warning only when at least one of its fields differs from the stored row. On a create, keep running it always.

The hard check already follows this rule: requireUniqueIgnoringCase (same template, ~line 1534) does not refuse again a value the row already stores. The soft check should do the same.

The sibling controllers (EntityController, EntityMyController, EntityPartnerController) all call repository.warnings(...), so the fix in the repository covers them.

Lingua principale
Java
Stelle
278
Fork
97
Merge medio
12h 43m
PR unite (30g)
296

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-dirigible/dirigible

Tutte le issue di eclipse-dirigible/dirigible

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.