fix(awards): the RDA arbitration writes CNTY, and settled rows leave the list

Two faults, and the first was a design mistake of mine.

The choice was written only as the award override, to keep the imported
CNTY as a record of what HAMLOG said. But CNTY is what the comparison
READS, so the contact went on disagreeing for ever: settle a hundred
rows, run the comparison again, get the same hundred back. The reasoning
was about preserving evidence; the effect was a button with no visible
consequence anywhere, which is indistinguishable from one that does
nothing. This is the operator's own log, and correcting a field in it is
the point of the exercise. The district now lands in CNTY as well as in
the award reference.

And the settled rows stayed on screen, which made the same button look
broken a second time. They are dropped as they are applied — locally,
rather than by re-running the comparison, which reads the whole log and
would be seconds of silence on a remote database to be told what is
already known. The agree/disagree counters follow.
This commit is contained in:
2026-08-26 11:08:15 +02:00
parent dc8f9c5099
commit 2e3464104d
4 changed files with 35 additions and 16 deletions
+13 -12
View File
@@ -163,20 +163,20 @@ type RDAApplyResult struct {
Message string `json:"message"`
}
// ApplyRDAChoices writes the chosen district onto each contact.
// ApplyRDAChoices writes the chosen district onto each contact — into CNTY and
// as the award reference, both.
//
// Written as the AWARD OVERRIDE rather than over the imported CNTY, and the
// difference matters. CNTY is what the downloaded log said; it is a record of
// what HAMLOG holds, and overwriting it would destroy the very evidence the
// comparison was run on — the next comparison would then agree with itself and
// prove nothing. The override is the operator's decision, it is what the award
// engine counts, and it wins over both sources. So the log keeps saying what it
// said, the database keeps saying what it says, and the contact counts for the
// district the operator chose.
// The first version wrote only the award override, to keep the imported CNTY as
// a record of what HAMLOG said. That was wrong in the way that matters: CNTY is
// what the comparison READS, so the contact went on disagreeing for ever. The
// operator settled a hundred contacts, ran the comparison again and got the
// same hundred rows — the decision had no visible effect anywhere, which is
// indistinguishable from a button that does nothing.
//
// A choice equal to what the database already answers is still written, on
// purpose: it records that the disagreement was looked at and settled, which a
// silent no-op would not.
// So the chosen district lands in CNTY, where it settles the disagreement, and
// in the award reference, where it decides what the contact counts for. This is
// the operator's own log: correcting a field in it is the point of the exercise,
// not a loss of evidence.
func (a *App) ApplyRDAChoices(choices []RDAChoice) (RDAApplyResult, error) {
var res RDAApplyResult
if a.qso == nil {
@@ -198,6 +198,7 @@ func (a *App) ApplyRDAChoices(choices []RDAChoice) (RDAApplyResult, error) {
if q.Extras == nil {
q.Extras = map[string]string{}
}
q.County = district
q.Extras[award.ManualRefsKey] = setOverrideRef(q.Extras[award.ManualRefsKey], "RDA", district)
if err := a.qso.Update(a.ctx, q); err != nil {
res.Failed++