fix(hamlog): a status AND a date, like every other service

Bulk edit offered two HAMLOG fields, both dates, and the first question they
drew was the right one: which of these is the status? Collapsing the flag into
the date was neat in the storage and a riddle in the dialog, where the eight
fields above it are four status/date pairs.

So four keys now — APP_OPSLOG_HAMLOG_SENT / _SENT_DATE and _QSL / _QSL_DATE —
and four fields, in the shape an operator already reads for eQSL, QRZ, Club Log
and HRDLog. The stamp written after a successful upload follows: Y in the
status, the day in the date.

Nothing else changes: the QSL Manager's backlog still asks whether the sent key
is present, and the award engine still treats any non-N value in the QSL key as
a confirmation.
This commit is contained in:
2026-08-23 13:14:05 +02:00
parent 3f82da3c18
commit f8fdfab031
6 changed files with 36 additions and 22 deletions
+11 -5
View File
@@ -12849,10 +12849,14 @@ func (a *App) extShouldUpload(svc extsvc.Service, id int64) bool {
// markExtUploaded stamps the per-service upload status on the QSO row and
// tells the frontend to refresh that row's confirmation columns.
// hamlogSentKey records the day a QSO went to HAMLOG.online. Shared with the
// row colours (lib/rowColors.ts) and the QSL Manager, so the three agree on
// what "already sent" means.
const hamlogSentKey = "APP_OPSLOG_HAMLOG_SENT"
// hamlogSentKey says a QSO has gone to HAMLOG.online; hamlogSentDateKey says
// when. Split the way every other service splits it — a status and a date —
// and shared with the row colours (lib/rowColors.ts), the QSL Manager's backlog
// and the bulk editor, so all four agree on what "already sent" means.
const (
hamlogSentKey = "APP_OPSLOG_HAMLOG_SENT"
hamlogSentDateKey = "APP_OPSLOG_HAMLOG_SENT_DATE"
)
func (a *App) markExtUploaded(svc extsvc.Service, id int64, logID string) {
date := time.Now().UTC().Format("20060102")
@@ -12896,7 +12900,9 @@ func (a *App) markExtUploaded(svc extsvc.Service, id int64, logID string) {
// a falsehood into every export. The date rather than a Y, so a log tells
// WHEN a contact went — and so the same shape serves the QSL Manager's
// backlog query, which asks "is this key present at all".
err = a.qso.SetExtra(ctx, id, hamlogSentKey, date)
if err = a.qso.SetExtra(ctx, id, hamlogSentKey, "Y"); err == nil {
err = a.qso.SetExtra(ctx, id, hamlogSentDateKey, date)
}
}
if err != nil {
applog.Printf("extsvc: mark %s uploaded %d failed: %v", svc, id, err)