Reject POTA activations with no matching QSOs (no empty ADIF)#164
Merged
Conversation
buildActivationAdif always returned one document per park even when no QSO rows matched, so an activation whose my_sig_info didn't line up would produce header-only ADIF files — the upload path would POST them and the share path would attach empty logs. Return an empty list when there are no rows; the upload guard (docs.isEmpty -> "no QSOs to upload") now fires correctly, and shareActivationAdif bails with onResult(false). Covered by two new tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes an edge case in the POTA ADIF export pipeline where an activation with zero matching QSO rows could still generate header-only ADIF documents, leading to empty uploads and empty shared attachments.
Changes:
- Update
PotaAdifExporter.buildActivationAdifto returnemptyList()when the activation query returns no rows (preventing header-only ADIF output). - Update
shareActivationAdifto bail out early withonResult(false)whenbuildActivationAdifreturns an empty list. - Add unit tests covering “no matching QSOs” and “no rows at all” cases to ensure the exporter returns an empty list rather than header-only documents.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ft8cn/app/src/test/kotlin/radio/ks3ckc/ft8us/ui/pota/BuildActivationAdifTest.kt | Adds regression tests ensuring empty results produce no ADIF documents. |
| ft8cn/app/src/main/kotlin/radio/ks3ckc/ft8us/ui/pota/PotaAdifExporter.kt | Prevents header-only ADIF generation by returning no documents when no QSO rows match; share path now rejects empty results. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #164 +/- ##
==========================================
- Coverage 6.53% 6.53% -0.01%
- Complexity 681 682 +1
==========================================
Files 269 269
Lines 31095 31113 +18
Branches 4889 4897 +8
==========================================
+ Hits 2031 2032 +1
- Misses 28922 28939 +17
Partials 142 142
🚀 New features to boost your workflow:
|
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.
What
Follow-up to #154 (merged). Fixes an edge case I flagged during that review.
PotaAdifExporter.buildActivationAdifreturned one ADIF document per parkregardless of whether any QSO rows matched the activation. So an activation
whose
my_sig_infodidn't line up (e.g. mismatched park string) producedheader-only ADIF files — the in-app upload path would happily
POSTthem,and the share path would attach empty logs.
Fix
buildActivationAdifreturns an empty list when no QSO rows match.docs.isEmpty()→ "no QSOs to upload") now fires correctly.shareActivationAdifbails withonResult(false)on an empty result.Tests
Two new cases in
BuildActivationAdifTest:All green;
testDebugUnitTestpasses on top ofdev.🤖 Generated with Claude Code