1) Regarding issue of two I/O operations on the database:
I am OK with this. I don't anticipate there will be a large number of users attempting to submit apps to App Store. There will likely be a maximum of 100 such transactions per day.
2) Regarding multiple entries in pending apps:
The first time a pending app is added to the database – after the user clicks "upload" the first time – an entry is made in the database.
At that point, its "user_approved" flag is the default value of false.
During the upload step, we should add some logic that first attempts to retrieve a pending App with the same coordinates before saving to the database.
More specifically, the steps would proceed like this - would this work?
1) User clicks "upload" to send a jar file to our site for processing
2) Jar file is parsed by our site to determine App Bundle_SymbolicName and Bundle_Version
3) Our code queries the database to determine if a row with identical values already exists in the database – all values captured in our database table, not just values extracted from the jar file itself, would need to be compared. This includes the jar file itself, which I believe is being saved in the database as a Django-specific object of some type. Our code that makes the comparison will need to be smart enough to handle this data type correctly.
4) If the row already is there, we do not create a new one. If not, we create a new row with the new values.
An out-of-scope thought related to this:
For safety and sanity, I feel like we should also save a unique string signature for the jar file being uploaded - a checksum.