Possible reason why duplicate folders are automatically created

A NextCloud client performs a locks on a particular folder when a it is editing it. This becomes problematic when two or more users edit the same folder at the same time. Note, not the simultaneous editing of same files within that folder but different files in the same folder. This happens because the NextCloud client performs a lock on that folder in the server. So, when a second user wants to modify that folder, it returns “locked”, resulting in the creation of duplicate folder/s. I’ve been bit by this bug for years. I thought NextCloud was not good but lately I figured that it was my fault. Following are some important facts I figured.

It seems that caching is very important and the only way around this is to use a caching method that suports transactional file locking. Currently, its only redis caching that support this. This brings me to my question from experts. How does NextCloud work at all without redis cache? Technically, it should not work for more than two users. I mean, its very likely a NextCloud system allows users to share folders accross multiple users. So, how does it work for others? Why am I the only one to have this problem? I am so baffled by this.

I am not an expert. I may have said wrong facts about NextCloud in this post. I would really appreciate if you correct my opinions if they are wrong. That would really help me get better in using NextCloud. thanks!

Reading more on this issue, it seems I am not the first person to have found this issue. There seems two solutions. First is to disable file locking for all and take a risk of corruption which happens rarely. Second is to use Redis as I already mentioned.