Uploaded image for project: 'Nuxeo Python Client'
  1. Nuxeo Python Client
  2. NXPY-209

Allow to pass a callback to uploads.refresh_token()

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 5.0.0
    • Component/s: Upload

      Description

      Allow to pass a callback to uploads.refresh_token() . It should be triggered after new token is retrieved.

      This will allow to do clean work on Nuxeo Drive, since NXPY-208 there is that error:

      2021-03-04 16:05:49 20822 123145562558464 ERROR    nxdrive.engine.processor Unknown error
      Traceback (most recent call last):
        File "/engine/processor.py", line 337, in _execute
          self._handle_doc_pair_sync(doc_pair, sync_handler)
        File "/engine/processor.py", line 240, in _handle_doc_pair_sync
          sync_handler(doc_pair)
        File "/engine/processor.py", line 947, in _synchronize_locally_created
          fs_item_info = self.remote.stream_file(
        File "/client/remote_client.py", line 582, in stream_file
          fs_item = self.upload(
        File "/client/remote_client.py", line 446, in upload
          return uploader(self).upload(path, **kwargs)
        File "/client/uploader/sync.py", line 31, in upload
          item = self.upload_impl(file_path, command, filename=filename, **kwargs)
        File "/client/uploader/__init__.py", line 206, in upload_impl
          self.upload_chunks(transfer, blob, chunked)
        File "/client/uploader/__init__.py", line 284, in upload_chunks
          self._patch_refresh_token(uploader, transfer)
        File "/client/uploader/__init__.py", line 408, in _patch_refresh_token
          uploader.service.refresh_token = refresh
      AttributeError: 'API' object attribute 'refresh_token' is read-only
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mschoentgen Mickaël Schoentgen
                Reporter:
                mschoentgen Mickaël Schoentgen
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h