Uploaded image for project: 'Task Management'
  1. Task Management
  2. TASKMGMT-22

Newly created tasks may not be stored in proper date folder

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.1
    • Labels:
    • Sprint:
      Basel 28
    • Story Points:
      3
    • Magnolia Release:
      5.4.5

      Description

      Customer reports that *freshly created tasks are not always stored into the correct folder*s. While it seems that task should be added into month and day directories in JCR, that sometimes does not seem to happen. As a result, the customer ends up with too many nodes in a single folder, causing performance problems.

      Please research this and provide a fix for it, if necessary.


      UPDATE
      The issue seems to be caused by the following:
      info.magnolia.task.persistence.TasksStoreImpl is a singleton which is injected with TaskPathGenerator. The latter initialises

      private AtomicLong atomicLong = new AtomicLong(System.currentTimeMillis());

      Each time a new task is persisted (created as new or updated) the following happens at
      info.magnolia.task.persistence.TasksStoreImpl.persist(Task)

         String taskNodeName = String.valueOf(taskPathGenerator.incrementAndGet());
         String parentPath = taskPathGenerator.getParentPath(taskNodeName);
      

      So, the parent path (e.g. /tasks/2015/11/2) is obtained by incrementing a counter which started at some point in time in the past, i.e. when TaskPathGenerator was instantiated and not necessarily reflects the current date.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              fgrilli Federico Grilli
              Reporter:
              weder Andreas Weder
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.75d
                  0.75d