Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3775

Design a dedicated component to handle temporary files lifecycle

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Won't Do
    • Neutral
    • None
    • 5.4.4
    • None
    • None
    • 13

    Description

      Attempts to solve issues related to clean-up of temporary files produced by form fields (MGNLDAM-636 and MGNLUI-3776) via a direct subscription to app/sub-app lifecycle events turned out to be rigid and error-prone: the same field type might be used in the scope of both sub-app and app (or even outside of both of them - e.g. in Pulse which exists in AdminCentral scope) => all those cases would have to be handled separately.

      One possible solution to this problem is to abstract from the actual specific type of the UIContext:

      • design a map-like temporary file storage
      • create temporary files through such storage (i.e. create a mere tmp file, but map it internally to the current UiContext)
      • provide capabilities to clean-up the storage per UiContext, so that all the apps/sub-apps could do remove tmp files related to them in an automatic way (in their #close() method or something).
      • I would maybe use the WeakHashMap internally for such a component, so that the storage wouldn't prevent "dead" UiContext instances from being GC'ed in case clean-up didn't happen (e.g. that specific UiContext just doesn't do that, failed to do that or whatnot and => it's the cron job's work in such case)

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                ilgun Ilgun Ilgun
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: