can't upload file with name containing XXMOJOXX
issue
how to reproduce :
upload a file containing XXMOJOXX in its name.
what is expected
the file is uploaded and added to the file list
what actually appends
the file is not uploaded and no more files can be uploaded without reloading the application.
explanation
In the code we can see that this magic word is used to separate byte stream into two parts, one which look like metadata, encoded in JSON and a second one which looks like a payload, encoded into a string containing escaped JSON, which again contains some metadata and the file part content. The actual ciphered file content being encoded into base64.
question
It is not clear why it is necessary to have this separation between metadata and some other metadata + data. Why all is not stored as sole object encoded in JSON, it would have simplified both server and client code.