nao-pon/flysystem-google-drive

Google Batch Request deprecated

SebTorres opened this issue · 9 comments

Google has deprecated use of batch requests. This in turn means that any call to the getFileObject function fails today, and will fail completely after August 12th.

We seem to face the same issue without even using the getFileObject.

I will fix this. Thanks for your information.

@SebTorres , @underthecocotree I have committed this fix to master branch. Can you verify that?

It seems to have been fixed. I will do a more thorough testing at the end of the week to confirm. Thank you!

The batch error has stopped but the file does not upload to the drive anymore. I have defined the root folder. Any ideas?

Edit: I tried f55cd5e and somehow it seems to work at the moment

[0] => {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "notFound",
    "message": "File not found: filename.pptx.",
    "locationType": "parameter",
    "location": "fileId"
   }
  ],
  "code": 404,
  "message": "File not found: filename.pptx."
 }
}

Thanks for the quick fix @nao-pon. I did a pull-request #80
with a possible fix .

This is the code that we have been using without any problems up to now.

$stream = fopen($this->files[$this->file_id]['tmp_name'], 'r+');

$response = $this->filesystem->putStream(
  $this->getNewFilename(),
    $stream,
    [
        'mimetype' => 'application/vnd.google-apps.presentation',
    ]
);

As far as I am aware Google is phasing the support for the batch, that might be the reason that the old code can still work without an error at times.

@underthecocotree Thank you for sending the PR. I made some changes after merging it. Please check 4bdef43 for any operational problems.

Looks great @nao-pon. It all seems to working fine now.

@underthecocotree Thank you for verifying. After that, I modified it to version 1.1.13. If you find any problems, please let me know.