automatically umounting usb flash drive?

I’m looking for clarification regarding automatically unmounting external storage. I read the docs here and the project here. I understand the first part, which is automatically mounting an external storage medium when it is inserted.

However, I don’t understand the automatic unmounting. Usually, we need to MANUALLY unmount an external disk BEFORE removing it. This is so that we do not corrupt any open files.
However, this project seems to be doing the umount AFTER it detects the removal.
Please clarify.

Hi, you are totally right in that a disk needs to be unmounted before removing it not to corrupt data. As you mention the unmount needs to be done manually.
The only way to perform safe automatic unmouting is to mount with the -o sync options which would write changes to disk immediately. The project you link would need to be modified to introduce this change. You also need to make sure the filesystem used supports synchronous writes.