Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25809

Files widget deletion leads to null blob

    XMLWordPrintable

    Details

    • Release Notes Summary:
      The deletion in the Files widget is correctly handled.
    • Tags:
    • Backlog priority:
      700
    • Sprint:
      nxcore 10.10.1
    • Story Points:
      3

      Description

      1. install Nuxeo
      2. install JSF UI (with 7.10 it is the default UI)
      3. create a custom document type having a field with files:files (see dragAndDrogFilesWidget.png)
      4. sync the project with the server
      5. create a document and attach 3 files using the button Add New Attached File
      6. save the document (see 3files.png)
      7. observe the JSON output shows the 3 files (see 3files.json)
      8. Edit the document
      9. select Delete for the third document
      10. save the document (see 2 files.png)
      11. observe the delete file appears as null (see 2files.json):
              {
                "file": null,
                "filename": null
              }
        
      12. click the Edit tab
      13. observe the third attached file is still detected (see emptyFile.png)

      Expected behavior: when deleting an attached file through the files widget, it should not be set as null but rather disappear completely.
      Note: deleting through the Files tab shows this is possible. Moreover in later versions using WebUI, the issue does not happen (the deletion is actually done through the Blob.RemoveFromDocument operation)
      Impact: this is an issue for clients like DotNet using operations that will list the blobs and expect them to be either present or not but not null, leading to an NPE:

      17/09/2018 14:11:54 ::> System.AggregateException: Une ou plusieurs erreurs se sont produites. ---> NuxeoClient.ServerErrorException: {"entity-type":"exception","code":"java.lang.NullPointerException","status":500,"message":null}
         à NuxeoClient.Client.<ProcessResponse>d__61.MoveNext()
      --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
         à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         à System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
         à NuxeoClient.Client.<ProcessRequest>d__60.MoveNext()
      --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
         à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         à System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
         à NuxeoClient.Client.<RequestJson>d__54.MoveNext()
      --- Fin de la trace de la pile à partir de l'emplacement précédent au niveau duquel l'exception a été levée ---
         à System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         à System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         à System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
         à NuxeoClient.Operation.<Execute>d__61.MoveNext()
         --- Fin de la trace de la pile d'exception interne ---
      

      It would be very tedious to list all the code assuming the blobs are not null rather than fixing the null value in the DB.
      Moreover, on a data-consistency view, it is better to fix the blob storage than to test for nullity.

      Workaround: use the Edit tab (when not disabled) to delete the file

        Attachments

        1. 2files.json
          2 kB
        2. 2files.png
          2files.png
          312 kB
        3. 3files.json
          2 kB
        4. 3files.png
          3files.png
          327 kB
        5. dragAndDrogFilesWidget.png
          dragAndDrogFilesWidget.png
          338 kB
        6. emptyFile.png
          emptyFile.png
          213 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 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
                  1d

                    PagerDuty

                    Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.