When an user is managing multiple uploads at the same time via the /artifact_temporary_files REST endpoints an concurrency issue can occur while computing the "size" headers as file might go missing while doing the computation:
public function getDiskUsage(PFUser $user): int
{
$size = 0;
foreach (glob($this->getPath($user, '*')) as $file) {
$size += \Psl\Filesystem\file_size($file);
}
return $size;
}
Users should move to the tus endpoints but anyway the code should account for the potential concurrency issue without crashing.