saros icon indicating copy to clipboard operation
saros copied to clipboard

Files with an unknown file extension are not handled correctly

Open tobous opened this issue 6 years ago • 0 comments
trafficstars

When creating a file with an unknown file extension (or by just choosing an extension from the drop-down list without also appending the correct file extension to the name), the other participant runs into issues. These issues are resolved once the other participants has opened the file and chosen a file type for it from the automatically displayed menu.

In the test-session, a lot of vector time violations occurred as well. These can most likely be attributed to the client dropping activities due to the document handling exiting ungracefully.

Steps to reproduce

  • Alice and Bob create a session
  • Alice creates a new file in the shared module by right-clicking a folder and selecting "New" > "File"
  • Alice chooses a name without a file extension (e.g. "Foo") and clicks "Ok"
  • Alice chooses any file type from the dialog without explicitly appending the corresponding file extension to the name and clicks "Ok"

Solution approaches

My guess would be that, as IntelliJ can't detect the file type, it can't determine the correct document implementation to use, leading to it failing to return a valid document instance for the file.

If this assumption is correct, the only option I can think of is queuing any activities for such files until it is opened the first time and a document representation becomes available. From the synchronization side of things, this should not be an issue as the user can't modify the file (through IntelliJ) without first choosing a file type for it. This does, however, introduce more memory overhead and the possibility of memory leaks if the file is never opened and the queue is never flushed (e.g. when the file is deleted).

tobous avatar Sep 10 '19 15:09 tobous