Summary: I’ve generated an ADIF file from two different generic logbooks created in HAMRS (on macosx 10.15.7) and I have seen the wrong names associated with callsigns.
HAMRS looks up names when callsigns are entered into the UI. I can’t put my finger on what triggers this, but I have discovered that there seems to be an off-by-one error when writing out the associated ADIF file.
The first record, in both cases of generated files, does not have the name relating to the call (the name:nn tag is also missing. However, the subsequent record has the name of what should’ve been in the first record.
So, in summary, record N + 1 has record N’s name tag and data.
Jarrett, if you need examples, I can send you an ADIF file generated that exhibits this problem.
What triggers this is debouncing the callsign input. If you’re really fast, and type the callsign and just click enter, I could see the current call saving, a new empty QSO being init’ed, and then the lookup from QRZ comes back, and populates, so essentially a winky race condition.
I need to think about what I want to do here. I could prevent saving if there is a QRZ lookup going on in the background. I was thinking about de-coupling the displaying of a QRZ pop-up from populating the QSO with the QTH info (perhaps on save). Right now that would take two calls and making sure I don’t overwrite, say, a their grid if you’ve entered it, and something comes back from QRZ that’s different.
Yeah, I’m sure it’s a timing issue. If you have a separate thread querying QRZ, that can take long enough to miss the QSO – and that is what probably happened in this case.
My preference would be that if the QRZ query runs for more than, say 5 seconds, OR if the next QSO is under way, cancel that query or ignore it’s results. Others may require a different approach. But, in general, if in doubt don’t record details.
Another possibility is to give each QSO a unique key and that key is copied into the QRZ querying thread. If the current QSO doesn’t match the QRZ query key, then either search for the corresponding QSO and fill it out in the background, or ignore it.