fix: a watched callsign is never parked; refuse uploads to unconfigured services
ZD8GB — watch-listed, six streams a period, two of them RR73 — was refused as "parked" for the rest of the session. Parking answers "it will not answer, stop wasting the evening on it", which is a fair verdict about a station the LOG picked out and the wrong one about a station the OPERATOR named: a DXpedition running a pileup takes more than two series of calls to get through to, which is exactly why it is on the list. The rest between series still applies, so it cannot monopolise the transmitter — it simply never becomes ineligible. Send to (right-click) now refuses a service with no credentials and says which are missing. The upload runs on its own goroutine and reports into the QSL Manager's console, which is not open when the command came from the QSO list, so an upload to an unconfigured service looked exactly like one that worked. The toast is also raised only once the backend has accepted the request, and Cloudlog / Wavelog and HamQTH name themselves in it.
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"hamlog/internal/extsvc"
|
||||
)
|
||||
|
||||
// An upload to a service with no credentials used to look exactly like one that
|
||||
// worked: it ran on its own goroutine and reported into the QSL Manager's
|
||||
// console, which is not open when the command came from the QSO list.
|
||||
func TestUploadRefusesAnUnconfiguredService(t *testing.T) {
|
||||
var empty extsvc.ExternalServices
|
||||
for _, svc := range []extsvc.Service{
|
||||
extsvc.ServiceCloudlog, extsvc.ServiceQRZ, extsvc.ServiceClublog,
|
||||
extsvc.ServiceHRDLog, extsvc.ServiceEQSL, extsvc.ServiceHamQTH, extsvc.ServiceLoTW,
|
||||
} {
|
||||
err := uploadConfigured(svc, empty)
|
||||
if err == nil {
|
||||
t.Errorf("%s: an unconfigured service was accepted", svc)
|
||||
continue
|
||||
}
|
||||
if !strings.Contains(err.Error(), "Settings") {
|
||||
t.Errorf("%s: %q does not say where to fix it", svc, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Configured: nothing in the way.
|
||||
cfg := extsvc.ExternalServices{}
|
||||
cfg.Cloudlog.URL, cfg.Cloudlog.APIKey = "https://log.f4bpo.fr", "cl123"
|
||||
if err := uploadConfigured(extsvc.ServiceCloudlog, cfg); err != nil {
|
||||
t.Errorf("a configured Cloudlog was refused: %v", err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user