Details
-
New Feature
-
Resolution: Won't Do
-
Neutral
-
None
-
5.4.4
-
None
-
None
-
-
Empty show more show less
-
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
Attachments
Issue Links
- is related to
-
MGNLDAM-636 The Upload & Edit action does not work anymore
-
- Closed
-
-
MGNLUI-3776 Remove AppLifecycleEvent handler from BasicUploadFieldFactory that deletes temporary file when app stops
-
- Closed
-