The code was written to keep a single image version event for each database transaction… even if they came from different metrics requests.
This is wrong, and this commit fixes it so that we only keep a single image version event per request.
The risk is theoretical at the moment because Azafea processes one request at a time, so the metrics request and the db session effectively have the same life cycle.
However, this has the potential to blow and cause data loss due to changes in the future if we changed that, so let's fix it now before it causes trouble.
The code was written to keep a single image version event for each database transaction… even if they came from different metrics requests.
This is wrong, and this commit fixes it so that we only keep a single image version event per request.
The risk is theoretical at the moment because Azafea processes one request at a time, so the metrics request and the db session effectively have the same life cycle.
However, this has the potential to blow and cause data loss due to changes in the future if we changed that, so let's fix it now before it causes trouble.