-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Saving file #72
Conversation
.env.example
Outdated
@@ -7,6 +7,8 @@ TLS=false | |||
TLS_KEY= | |||
TLS_CERT= | |||
JWT_SECRET_KEY=your_secret_key | |||
WHITEBOARD_SHARED_SECRET=your_shared_secret |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we could just use the JWT_SECRET_KEY as it is shared already?
websocket_server/roomData.js
Outdated
if (!roomUsers.has(roomId)) { | ||
return null | ||
} | ||
// TODO: Check if the user has write permissions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be still nice to address before merging.
} | ||
|
||
$userFolder = $this->rootFolder->getUserFolder($user->getUID()); | ||
$file = $userFolder->getById($fileId)[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few things we should check here when getting the file, best see
for all edge cases that may occur 🙈
if (!$user) { | ||
return new DataResponse(['message' => 'Invalid user'], Http::STATUS_BAD_REQUEST); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to call setVolatileActiveUser
to make sure the write is also in scope of the user (e.g. for creating versions and activity entries).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments but generally looks fine 👍
96ffc78
to
fa14485
Compare
Signed-off-by: Hoang Pham <[email protected]> feat: Saving file Signed-off-by: Hoang Pham <[email protected]> feat: Saving file Signed-off-by: Hoang Pham <[email protected]> feat: Saving file Signed-off-by: Hoang Pham <[email protected]>
fa14485
to
408f158
Compare
@hweihwang I squashed your commits into one. ;) Looks all nice and saving is smooth also with sharing involved. |
No description provided.