On macOS the file system normalizes the path and actualFileName !== filenamify(fileName)
When creating files inside of Dropbox the problem is even bigger because Node.JS returns the actual file name but you should wait before trying to retrieve the name (some milliseconds that may differ on each system).
Have you considered running
path.normalize('NFD')
to the filename?Why?
actualFileName !== filenamify(fileName)