Working on a site that had #2 comment's patch applied, we faced a problem with the automatic download after the batch finished. More specifically:
file_managed
table was not updated and pointed to the temporary directory.$headers
in finishBatch()
were empty because the function failed to find the file via its URI and consequently it was not downloaded.Based on that patch, I added some code in order to update the respective database entry with the new URI (that points to private directory), along with a couple of log messages to have a better overview of the process.