magicbug / Cloudlog

Web based amateur radio logging application built using PHP & MySQL supports general station logging tasks from HF to Microwave with supporting applications to support CAT control.
http://www.cloudlog.co.uk
MIT License
450 stars 189 forks source link

feature request: prevent to record same qso on multiple submission #1275

Open iddq opened 2 years ago

iddq commented 2 years ago

same qso recorded if user pressing the button multiple times or refresh the page in browser with F5

AndreasK79 commented 2 years ago

@iddq I've seen this problem before. Not sure how to fix, other than making a call to the database before inserting.

magicbug commented 2 years ago

Yes think so, its been a lurking thing in Cloudlog from the start

T012m3n7oR commented 2 years ago

Should be able to resolve this with an if not exists clause on the insert, I can see if I have time this weekend to review the SQL on how it's inserting.

AndreasK79 commented 2 years ago

Add_qso() in logbook_model is the one inserting. It is called from several places. The one used on import, has a basic duplicate check. The ADIF import has an option to skip for duplicate check, so I think the best would be to move the duplicate check (and extend it to check on satellite and sub-mode) into add_qso, with the option to skip it.