fix: Improve update_flow data consistency, refine error handling, and add folder-moving tests
#5516
+93
−25