- do not hardcode a timeout, requests will either complete or eventually fail
- use a single event handler at the end of the request to decide if and how to reschedule the upload. This prevents the possibility that the same error event triggers multiple uploads via different handlers
Implement a checksum + cache mechanism to check whether user is sending the same file multiple times:
this is needed to address the problem of timeouts, where the server might process a request even when the client has given up and rescheduled the upload. We now store the latest checksum that has been received and compare it with the new picture.
Address a problem encountered already with proctoring uploads: in cases that count both as timeouts and errors, the rescheduling of the request would happen twice. If the condition persists, the number of requests can grow out of control