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

Newly created tasks may not be stored in proper date folder

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 1.1.1
    • None
    • Basel 28
    • 3

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD

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