When trying to access an invalid entry (i.e. the file has been deleted or the entry-ID is inconsistent) that requires authorization, the database record should get expunged before attempting to update the auth log.
Current Behavior
If there's a stray entry with an ID mismatch (due to weird edge-case race conditions), an attempt at accessing the entry will delete the item from the database, but then attempting to log the access results in a database error, which rolls back the transaction.
Expected Behavior
When trying to access an invalid entry (i.e. the file has been deleted or the entry-ID is inconsistent) that requires authorization, the database record should get expunged before attempting to update the auth log.
Current Behavior
If there's a stray entry with an ID mismatch (due to weird edge-case race conditions), an attempt at accessing the entry will delete the item from the database, but then attempting to log the access results in a database error, which rolls back the transaction.
Possible Solution
Steps to Reproduce (for bugs)
1. 2. 3. 4.
Context