Skip to content

Reject POTA activations with no matching QSOs (no empty ADIF)#164

Merged
patrickrb merged 1 commit into
devfrom
fix/pota-empty-activation-adif
Jun 8, 2026
Merged

Reject POTA activations with no matching QSOs (no empty ADIF)#164
patrickrb merged 1 commit into
devfrom
fix/pota-empty-activation-adif

Conversation

@patrickrb

Copy link
Copy Markdown
Owner

What

Follow-up to #154 (merged). Fixes an edge case I flagged during that review.

PotaAdifExporter.buildActivationAdif returned one ADIF document per park
regardless of whether any QSO rows matched
the activation. So an activation
whose my_sig_info didn't line up (e.g. mismatched park string) produced
header-only ADIF files — the in-app upload path would happily POST them,
and the share path would attach empty logs.

Fix

  • buildActivationAdif returns an empty list when no QSO rows match.
  • The upload guard (docs.isEmpty() → "no QSOs to upload") now fires correctly.
  • shareActivationAdif bails with onResult(false) on an empty result.

Tests

Two new cases in BuildActivationAdifTest:

  • a row exists but for a different park → empty list (not header-only docs)
  • no rows at all → empty list

All green; testDebugUnitTest passes on top of dev.

🤖 Generated with Claude Code

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.buildActivationAdif to return emptyList() when the activation query returns no rows (preventing header-only ADIF output).
  • Update shareActivationAdif to bail out early with onResult(false) when buildActivationAdif returns 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

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 6.53%. Comparing base (16bd3c9) to head (07fff06).
⚠️ Report is 26 commits behind head on dev.

Files with missing lines Patch % Lines
...lin/radio/ks3ckc/ft8us/ui/pota/PotaAdifExporter.kt 25.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            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              
Files with missing lines Coverage Δ
...lin/radio/ks3ckc/ft8us/ui/pota/PotaAdifExporter.kt 66.34% <25.00%> (-1.66%) ⬇️

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@patrickrb patrickrb merged commit 74f147b into dev Jun 8, 2026
5 checks passed
@patrickrb patrickrb deleted the fix/pota-empty-activation-adif branch June 8, 2026 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants