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

Ignore incomplete custom protocol URL token requests

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 5.2.2
    • Component/s: Framework

      Description

      Situation

      Sentry Issue: NUXEO-DRIVE-54E

      KeyError: 'local_folder'
        File "nxdrive\gui\api.py", line 945, in create_account
      
      UnboundLocalError: local variable 'local_folder' referenced before assignment
        File "nxdrive\gui\application.py", line 1694, in _handle_connection
        File "nxdrive\gui\application.py", line 1649, in _handle_nxdrive_url
        File "nxdrive\gui\api.py", line 938, in handle_token
        File "nxdrive\gui\api.py", line 965, in create_account
      

      To reproduce:

      • Add an account.
      • The browser is opened to login page, the user enters credentials and is redirected to the Nuxeo Drive special startup page.
      • The app handles the requests and adds the account.
      • Quit the app.
      • Refresh the Nuxeo Drive startup page.
      • See the crash.

      Analysis

      It happens when the app is not started. The handling of the custom protocol URL (nxdrive://token/95f2af16-4ff8-4c58-92c6-0441fdca3286/user/Administrator for instance) is done with empty callback_params.
      callback_params are set by the app before opening the loging page and here, as the app has not initiated the process itself, it are empty.

      Note: the bug was present before 5.2.0 but it was silently suppressed.

      Solution

      Do nothing when callback_params are empty.

        Attachments

          Issue Links

            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 - 1 hour
                  1h