Issue
Surprinsingly, when an error is thrown from the Processor, it is not catched and we have such stacktraces:
File "nxdrive\engine\processor.py", line 262, in _execute File "nxdrive\engine\processor.py", line 743, in _synchronize_locally_created File "nxdrive\client\remote_client.py", line 377, in stream_file File "nxdrive\client\remote_client.py", line 220, in upload File "lib\site-packages\nuxeo\uploads.py", line 60, in post File "lib\site-packages\nuxeo\client.py", line 197, in request Unauthorized: Unauthorized(401), error: '...,' server trace: None
Fix
Instead of stopping the synchronization and putting the Engine in offline mode, as this error can happen on different level in the tree, we will put those documents in error.
And when the user will have enough rights to sync them, errors will automatically be removed and files synced.
If the user lost its token for real, the RemoteWatcher will set invalid credentials when looking for remotes changes.