mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
This was a bug that was most notable during the attachment pre-upload process: if an attachment failed to upload, the subsequently-enqueued PushMediaSendJob would still send. This is because the attachment jobs were enqueued first and failed *before* we enqueued the PushMediaSendJob as a dependency. This will use the JobTracker to determine if a dependency already failed at the time of enqueueing a job like this. This isn't perfect, because the JobTracker is memory-only and has a limited buffer (currently 1000), but in practice this should be sufficient for our use cases. I imagine it'd only fall apart if we somehow enqueued a dependent job *much* later, or somehow enqueued it based on a job ID that we persisted on disk through an app restart. We don't do any of these things, currently, and probably never should. Also took the opportunity to patch a case where we weren't failing dependent jobs when canceling a job, since I was giving the failure stuff a look-over.