Skip to content

Fix TCP API RX.DIRECTED to match DIRECTED.txt output#176

Merged
Chris-AC9KH merged 4 commits into
JS8Call-improved:masterfrom
mgochoa57:fix-tcp-duplicate-callsign
Feb 1, 2026
Merged

Fix TCP API RX.DIRECTED to match DIRECTED.txt output#176
Chris-AC9KH merged 4 commits into
JS8Call-improved:masterfrom
mgochoa57:fix-tcp-duplicate-callsign

Conversation

@mgochoa57

@mgochoa57 mgochoa57 commented Jan 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix duplicate callsign issue where FROM was appearing in both the FROM field and VALUE/TEXT fields in TCP API RX.DIRECTED messages
  • Include the user-configured eot (end of transmission) character in TCP API output for consistency with DIRECTED.txt file
  • Refactor to use single baseText variable with clear comments explaining the data flow

Problem

When JS8Call sends directed messages via TCP API, there were two issues:

  1. The sender's callsign appeared twice (in FROM field AND in VALUE/TEXT content)
  2. The eot character (♢) appeared in DIRECTED.txt but not in the TCP API live feed

Solution

Refactored to use a single baseText variable:

  • baseText contains "TO CMD EXTRA TEXT [eot]" (used for TCP API where FROM is a separate JSON field)
  • text contains "FROM: TO CMD EXTRA TEXT [eot]" (used for DIRECTED.txt file and UI display)

This ensures the eot character is applied once and consistently appears in both outputs, while keeping FROM out of the VALUE/TEXT fields.

Test plan

  • Verify DIRECTED.txt file output format is unchanged: FROM: TO CMD EXTRA TEXT ♢
  • Verify TCP API RX.DIRECTED VALUE/TEXT fields contain TO CMD EXTRA TEXT ♢ (no FROM prefix, includes eot)
  • Verify TCP API RX.DIRECTED FROM field contains the callsign separately

🤖 Generated with Claude Code

mgochoa57 and others added 4 commits January 29, 2026 12:38
The value field in RX.DIRECTED messages was using the formatted 'text'
variable which includes the FROM callsign prefix. When TCP clients
reconstruct messages as "FROM: value", this resulted in duplicate
callsigns (e.g., "W9TEK: W9TEK: KC1QKM SNR -05").

Changed the value parameter from 'text' to 'd.text' (the raw message
body without FROM prefix) to match the TEXT parameter behavior.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
    FROM prefix

   The previous fix incorrectly used d.text which is empty for simple
   directed messages. This fix properly constructs valueWithoutFrom
   from the message components (d.to, d.cmd, d.extra, d.text).
Both value and TEXT fields now contain the message body without
the FROM prefix, making the API consistent and useful for clients.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mgochoa57 mgochoa57 changed the title Fix duplicate callsign in TCP API RX.DIRECTED messages Fix TCP API RX.DIRECTED to match DIRECTED.txt output Jan 30, 2026
wmiler
wmiler previously approved these changes Jan 30, 2026
@wmiler wmiler dismissed their stale review January 30, 2026 21:32

Didn't read this quite as well as I meant to.

@wmiler

wmiler commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

Why do you want the EOT character in the API feed?

@mgochoa57

mgochoa57 commented Jan 30, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@wmiler

wmiler commented Jan 30, 2026

Copy link
Copy Markdown
Collaborator

As you know, I’ve been working to fix an issue with duplicate callsigns in the API feed. My first attempt didn’t resolve the problem (#123). The second attempt did eliminate the duplicate callsigns by introducing a second variable, but it also removed the EOT character, which had always been present in the API output. After reviewing the logic again, I realized the second variable wasn’t necessary. I refactored the code back to a single variable, which restores the EOT character while still addressing the original issue. I haven’t tested this version yet, but I’m confident it should work. I’ll verify it tonight when I get home.

Ah, ok, gotcha.

@mgochoa57

mgochoa57 commented Jan 31, 2026 via email

Copy link
Copy Markdown
Collaborator Author

@wmiler wmiler added the ready Ready to merge label Jan 31, 2026
@Chris-AC9KH Chris-AC9KH merged commit f17f38a into JS8Call-improved:master Feb 1, 2026
@Chris-AC9KH

Copy link
Copy Markdown
Collaborator

Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready Ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants