Repository navigation
Conversation
A Wavelog user whose Station ID belongs to a different user than the API key passes Test Connection and then has every QSO rejected with HTTP 401 "station id does not belong to the API key owner." The app showed "0 accepted" and nothing else; the reason only lived in debug.log. - Catch-up sync dialog: show each service's rejection reason (JSON wrapper stripped) and, for Cloudlog-family servers, a hint naming the setting to fix (Station ID / API key). - Post-QSO upload and background auto-sync: toast the same reason + hint. - Cloudlog settings dialog: after Test Connection, warn when the entered Station ID is blank or not in the station list the server returned for this key. - debug.log: log the station_profile_id on every rejected upload. New pure helpers (CloudlogFailureHint.kt, StationIdCheck.kt) with unit tests; verified on the emulator against a mock Wavelog. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #923 +/- ##
============================================
- Coverage 41.51% 41.51% -0.01%
- Complexity 252 273 +21
============================================
Files 280 282 +2
Lines 33993 34078 +85
Branches 4034 4060 +26
============================================
+ Hits 14112 14146 +34
- Misses 19592 19641 +49
- Partials 289 291 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Automatic-upload rejection notifications do not reach the Compose UI, leaving a central reporting path ineffective.
4 open issues
What changed in this PR
Adds upload-rejection explanations to FT8AF’s logging workflows so operators can diagnose Cloudlog-family configuration problems.
Changes:
- Adds server-reason formatting and settings hints to upload results.
- Adds Station ID warnings and rejection diagnostics.
- Adds tests for failure parsing and station validation.
| File | Description |
|---|---|
| ft8af/app/src/test/kotlin/radio/ks3ckc/ft8af/ui/settings/StationIdCheckTest.kt | Tests station validation. |
| ft8af/app/src/test/kotlin/radio/ks3ckc/ft8af/sync/CloudlogFailureHintTest.kt | Tests rejection parsing and hints. |
| ft8af/app/src/test/java/com/k1af/ft8af/log/ThirdPartyServiceFailureReasonTest.java | Tests diagnostic Station ID formatting. |
| ft8af/app/src/main/res/values/strings_compose.xml | Adds rejection and warning text. |
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/settings/StationIdCheck.kt | Adds station-list validation. |
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/settings/LoggingSettings.kt | Displays Station ID warnings. |
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/ui/logbook/LogbookScreen.kt | Displays catch-up rejection details. |
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/sync/QsoAutoSync.kt | Adds automatic-sync failure notifications. |
| ft8af/app/src/main/kotlin/radio/ks3ckc/ft8af/sync/CloudlogFailureHint.kt | Formats rejection reasons and hints. |
| ft8af/app/src/main/java/com/k1af/ft8af/MainViewModel.java | Adds post-QSO rejection notifications. |
| ft8af/app/src/main/java/com/k1af/ft8af/log/ThirdPartyService.java | Propagates failures and logs Station IDs. |
Review effort: Balanced
Comment on lines
+1137
to
+1139
| ToastMessage.show(String.format( | ||
| getStringFromResource(R.string.cloudlog_upload_rejected), | ||
| CloudlogFailureHint.cloudlogFailureMessage(why.toString()))); |
Comment on lines
+35
to
+39
| private val MESSAGES = Regex("\"messages\"\\s*:\\s*\\[(.*?)]") | ||
| private val QUOTED = Regex("\"((?:[^\"\\\\]|\\\\.)*)\"") | ||
|
|
||
| private fun unescapeJson(s: String): String { | ||
| return s.replace("\\\"", "\"").replace("\\/", "/").replace("\\\\", "\\") |
| fun classifyCloudlogFailure(failure: String?): CloudlogFailureKind { | ||
| val reason = cloudlogServerReason(failure).lowercase() | ||
| if (reason.isEmpty()) return CloudlogFailureKind.OTHER | ||
| if (reason.contains("station")) return CloudlogFailureKind.STATION_ID |
| <string name="settings_station_id">Station ID</string> | ||
| <string name="settings_station_id_hint">e.g. 1</string> | ||
| <string name="settings_station_id_missing">No Station ID selected. Pick one from the list or every upload will be rejected.</string> | ||
| <string name="settings_station_id_not_on_server">Station ID %1$s is not one of this API key\'s stations. Pick one from the list.</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Why
A Wavelog user reported "the API link tests OK but no contacts are accepted". Their debug.log had the answer on every upload:
The Station ID they entered belongs to a different Wavelog user than the API key. Test Connection only hits
api/auth, so it passes, and the app then showed "Cloudlog / Wavelog / Nextlog: 0 accepted" with no reason. This PR makes the server's own explanation visible everywhere an upload result reaches the screen.What changed
MainViewModel.doAfterTransmit) and background auto-sync (QsoAutoSync): toast the same reason + hint instead of failing silently.Cloudlog: upload rejected with station_profile_id=<id>so the next report is a one-line diagnosis.New pure helpers so the logic is unit-testable:
sync/CloudlogFailureHint.kt(cloudlogServerReason,classifyCloudlogFailure,cloudlogHintResId,cloudlogFailureMessage) andui/settings/StationIdCheck.kt(checkStationId). Wavelog's exact reason strings were taken from itsApi.php.Tests
CloudlogFailureHintTest(8),StationIdCheckTest(5),ThirdPartyServiceFailureReasonTest(+1 fordescribeStationId),QsoAutoSyncSummaryTest— all green.api/qsoPOST → the 401 above): the settings dialog shows Pass plus "Station ID 7 is not one of this API key's stations. Pick one from the list."; the sync dialog shows "rejected uploads: station id does not belong to the API key owner." followed by the Station ID hint; debug.log has the newstation_profile_id=7line.cloudlogFailureMessagepath as the dialog.🤖 Generated with Claude Code