Uploaded image for project: 'Nuxeo Drive '
  1. Nuxeo Drive
  2. NXDRIVE-1549

Fix DirectEdit unlock issue with missing Engine

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.4
    • Fix Version/s: 4.1.0
    • Component/s: Direct Edit

      Description

      The error:

      nxdrive.direct_edit Cannot unlock document '/UID_file-content/file.docx'
      Traceback (most recent call last):
       File "nxdrive\direct_edit.py", line 479, in _handle_lock_queue
       File "nxdrive\direct_edit.py", line 511, in _send_lock_status
      KeyError: 'cf92552e289611e9a04e9cda3ee6307e'
      

      The fix:

      diff --git a/nxdrive/direct_edit.py b/nxdrive/direct_edit.py
      index 8685c180..7e1da9f9 100644
      --- a/nxdrive/direct_edit.py
      +++ b/nxdrive/direct_edit.py
      @@ -525,9 +525,8 @@ class DirectEdit(Worker):
       
           def _send_lock_status(self, ref: str) -> None:
               manager = self._manager
      -        for engine in manager._engine_definitions:
      -            dao = manager._engines[engine.uid]._dao
      -            state = dao.get_normal_state_from_remote(ref)
      +        for engine in manager._engines.values():
      +            state = engine._dao.get_normal_state_from_remote(ref)
                   if state:
                       path = engine.local_folder / state.local_path
                       manager.osi.send_sync_status(state, path)
      

      A test should be added to prevent regression.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 2 hours
                2h