Description
Hello,
On our project (Mendix v9.12.5) we encountered an issue with the usage of the combination of the OnAccept, AfterAccept and AfterCommit flow.
Expected behavior
The expected behavior would be the OnAccept action at first when the user uploads a file. If it meets the criteria (defined in the OnAccept) to enter the application then AfterAccept action would start. When this flow ends successfully, the BeforeCommit action can be started, then the file can be Committed and as last if it is required the AfterCommit can be triggered.
(Same idea for nanoflows of course : ) )
The issue(s)
The OnAccept flow works fine, if the logic returns an invalid then the whole process will stop accordingly and it will return the error message. However the AfterAccept and Before/After commit are not working properly. The aftercommit seems in every case that I tried to start before the AfterAccept, so if a file doesn’t fit the criteria (eg. due an invalid mime type, one of our checks) then you have already committed in the databbase and is the widget trying to set context in the aftercommit. During that moment the AfterAccept is also running parallel, or even triggered after the BeforeCommit or AfterCommit. In some of those cases the (System)File was removed from the database during or after the commit happened. Which causes several different issues (not at once) such as grey out FileDropper widget in the runtime, Mendix message that an object could not be changed due it not being in the database anymore etc.
Logging to show the sequence of flows, each flow is logged at start and finish. FileHelper is the OnAccept, LanguagePDF is the afterCommit and onAccept is the onAccept flow.
Looking forward to your reply, kind regards,
Thijs
ps: if you need more information or feedback feel free to message me.