Photoshop hangs on return to working state after execution completion of an external exporter plugin
We have created an external plugin for photoshop to export the details of a design done in photoshop to a format that we require in-order to process them after that. This exporting process time depends on the size of the scene and layers and its details.
While exporting, the UI is updated accordingly to the exporting process. However, we observed a lag of a few seconds in photoshop returning to the usable and user controllable state after the completion of the plugin execution. We have identified that the lag occures after the completion of the process of the plugin and have reasonable facts to make the statement that the said lag is occured not due to the plugin we have exported.
Would there be any cause for such a behaviour on photoshop side which might cause this to happen? Any process or procedure that photoshop might follow in-order to return to a controllable state after being utilized through a script? Or, any callback like function that we might need to provide an update to in photoshop to inform the completion of the execution?