fix note creation on encrypted s3 storage

This commit is contained in:
korelstar 2021-03-04 22:03:59 +01:00
parent 23168c56bf
commit 6001c37481
2 changed files with 0 additions and 13 deletions

View File

@ -176,7 +176,6 @@ class NotesController extends Controller {
public function create(string $category) : JSONResponse {
return $this->helper->handleErrorResponse(function () use ($category) {
$note = $this->notesService->create($this->helper->getUID(), '', $category);
$note->setContent('');
return $note->getData();
});
}

View File

@ -108,18 +108,6 @@ class NotesService {
// create file
$file = $folder->newFile($filename);
// try to write some content
try {
// If server-side encryption is activated, the server creates an empty file without signature
// which leads to an GenericEncryptionException('Missing Signature') afterwards.
// Saving a space-char (and removing it later) is a working work-around.
$file->putContent(' ');
} catch (\Throwable $e) {
// if writing the content fails, we have to roll back the note creation
$this->delete($userId, $file->getId());
throw $e;
}
return new Note($file, $notesFolder, $this->noteUtil);
}