From ee8fd32bf74537b6a5e6d0b328f98bf47cdef7ab Mon Sep 17 00:00:00 2001 From: rouggy Date: Thu, 27 Aug 2026 15:57:41 +0200 Subject: [PATCH] fix(matrix): dot the portable variants too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header counts QSOs with the callsign through callMatch — RI1FJL/1 and ZA/RI1FJL included — while the grid's own per-callsign columns matched the bare string. A cell could hold one of the QSOs the header had counted and show nothing. --- internal/qso/qso.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/qso/qso.go b/internal/qso/qso.go index 349f9a4..221f010 100644 --- a/internal/qso/qso.go +++ b/internal/qso/qso.go @@ -2236,13 +2236,17 @@ func (r *Repo) WorkedBefore(ctx context.Context, callsign string, dxccHint int, // The grid answers "what do I still need on this band and mode", and for // that question confirmation is the axis that matters: a confirmed entity // needs nothing, whoever else was worked afterwards. + // The two per-callsign columns use the SAME predicate as the callsign count + // above, portable variants included: a cell that counts RI1FJL/1 in "worked + // with this call" and a header that does not would be two answers to one + // question. // Filter NULL/empty band+mode rows — they'd create a NULL group key // that Scan into *string can't handle and would error out the whole // WorkedBefore call, blanking the matrix in the UI. statusRows, err := r.db.QueryContext(ctx, ` SELECT band, mode, - MAX(CASE WHEN callsign = ? THEN 1 ELSE 0 END), - MAX(CASE WHEN callsign = ? + MAX(CASE WHEN `+pred+` THEN 1 ELSE 0 END), + MAX(CASE WHEN `+pred+` AND (lotw_rcvd IN `+ConfirmedValues+` OR qsl_rcvd IN `+ConfirmedValues+` OR eqsl_rcvd IN `+ConfirmedValues+`) THEN 1 ELSE 0 END), MAX(CASE WHEN lotw_rcvd IN `+ConfirmedValues+` OR qsl_rcvd IN `+ConfirmedValues+` OR eqsl_rcvd IN `+ConfirmedValues+` @@ -2251,7 +2255,7 @@ func (r *Repo) WorkedBefore(ctx context.Context, callsign string, dxccHint int, WHERE dxcc = ? AND band IS NOT NULL AND band != '' AND mode IS NOT NULL AND mode != '' - GROUP BY band, mode`, wb.Callsign, wb.Callsign, dxcc) + GROUP BY band, mode`, append(append(append([]any{}, predArgs...), predArgs...), dxcc)...) if err != nil { return wb, fmt.Errorf("band status: %w", err) }