fix(wavelog): a 200 is not an acceptance
WaveLogApi decided an upload had succeeded from the HTTP status alone. Wavelog validates
after responding, so a rejected QSO comes back as 200 with `{"status":"failed","reason":
"..."}` - and the uploader then called markUploaded and dropped it from the queue. The
contact was lost and the operator was told the upload succeeded.
Response shapes are transcribed from the Wavelog API reference, not guessed: success is
`status: success` or `successful`, a duplicate is `status: dupe` with a 200, failures are
`status: failed` with `reason` or `status: error` with `message`.
WavelogResponse reads the body. Four outcomes: accepted and duplicate both clear the
queue entry, because the log holds the QSO either way; rejected keeps it and surfaces the
server's own explanation; and a status field we cannot recognise also keeps it, since
costing a retry beats losing a contact. Parsed as text rather than with JSONObject because
org.json is compileOnly in core:domain and a JVM test would otherwise assert against a
stub. Whitespace around separators is collapsed before matching - a first attempt listed
spacings and missed `{ "status" : "failed" }`, which a probe caught.
Two other things in the same area.
The ten-minute auto-upload loop is gone. It retried the queue in the background with no
way to tell the operator anything: a grid mismatch was swallowed by an empty if block and
every other failure retried silently forever. A QSO that cannot be uploaded now waits for
a manual upload from settings, where the result is actually shown.
The upload path no longer builds user-facing text in Kotlin. UploadOutcome carried a
pre-formatted Chinese string, so the message ignored the device language whatever the
locale files said. It now reports a Reason the view model maps to resources, which needed
a format-argument overload on IShowToast to get a count into a localised message.
This commit is contained in:
1 parent
fe6d0af8b7
commit
4567f46867
10 files changed
+392
-39
No files matched your search
@@ -261,6 +261,13 @@
|
||||
<string name="wavelog_call_hint">对方呼号</string>
|
||||
<string name="wavelog_mode_hint">模式</string>
|
||||
<string name="wavelog_saved">已存入本地日志</string>
|
||||
<string name="wavelog_upload_done">已上传 %1$d 条, %2$d 条仍在队列</string>
|
||||
<string name="wavelog_upload_all_ok">已上传 %1$d 条</string>
|
||||
<string name="wavelog_not_configured">未配置 WaveLog 服务器</string>
|
||||
<string name="wavelog_no_station">读不到站点信息 - 请检查站点 ID 与密钥权限</string>
|
||||
<string name="wavelog_upload_failed">上传失败</string>
|
||||
<string name="lotw_list_updated">LoTW 卫星列表已更新: %1$d 个</string>
|
||||
<string name="lotw_list_failed">LoTW 列表更新失败: %1$s</string>
|
||||
<string name="log_call_too_short">呼号太短</string>
|
||||
<string name="log_call_illegal">呼号里不能有这个字符</string>
|
||||
<string name="log_call_not_a_call">这看起来不像呼号</string>
|
||||
|
||||
@@ -292,6 +292,13 @@
|
||||
<string name="wavelog_call_hint">Callsign</string>
|
||||
<string name="wavelog_mode_hint">Mode</string>
|
||||
<string name="wavelog_saved">Saved to local log</string>
|
||||
<string name="wavelog_upload_done">Uploaded %1$d, %2$d still queued</string>
|
||||
<string name="wavelog_upload_all_ok">Uploaded %1$d QSO</string>
|
||||
<string name="wavelog_not_configured">WaveLog server not configured</string>
|
||||
<string name="wavelog_no_station">Cannot read the station profile - check the station ID and key permissions</string>
|
||||
<string name="wavelog_upload_failed">Upload failed</string>
|
||||
<string name="lotw_list_updated">LoTW satellite list updated: %1$d entries</string>
|
||||
<string name="lotw_list_failed">LoTW list update failed: %1$s</string>
|
||||
<string name="log_call_too_short">Callsign too short</string>
|
||||
<string name="log_call_illegal">A callsign cannot contain that</string>
|
||||
<string name="log_call_not_a_call">That does not look like a callsign</string>
|
||||
|
||||
Reference in new issue
Block a user