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

Prevent duplicate creation via Direct Transfer

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: NoFixVersionApplicable
    • Fix Version/s: 4.3.0
    • Component/s: Direct Transfer

      Description

      Scope

      Before uploading anything, a check has to be done to prevent duplicates.

      • By default, if the document does not exist: create a new document.
      • If a document with the same name already exists on the server:
        • if the document has a blob stored into the file:content xpath, asks the user for:
          • upload cancellation;
          • blob replacement.
        • If the document has no attached blob (in case of a previous failure at the upload step):
          • upload and attach the blob.

      Possible Issue

      Note about possible duplicate creation via a race condition client <-> server.
      Given the local file with the path "$HOME/some-folder/subfolder/file.odt", the file name is "file.odt".

      Scenario:

      • Step 1: local, check for a doc with the path name "file.odt" => nothing returned, continuing;
      • Step 2: server, a document with a path name set to "file.odt" is created;
      • Step 3: local, create the document with the path name "file.odt".

      Even if the elapsed time between steps 1 and 3 is really short, it may happen.

      What can be done to prevent such scenario is not on the Nuxeo Drive side but on the server one.
      For now, 2 options are possible but not qualified to be done in a near future:

      • NXP-22959;
      • create a new operation Document.GetOrCreate that ensures atomicity.

        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 day, 4 hours
                  1d 4h