Closed
Bug 1099063
Opened 10 years ago
Closed 10 years ago
[Rooms] PATCH /rooms/{token} doesn't respect optional parameters (overwrites/deletes them in the room data)
Categories
(Hello (Loop) :: Server, defect)
Hello (Loop)
Server
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: standard8, Unassigned)
References
Details
(Whiteboard: [qa?][loop-server 0.14])
Attachments
(1 file)
The documentation for PATCH /rooms/{token} says it all items are optional:
https://docs.services.mozilla.com/loop/apis.html#post-rooms-token
Optional request body parameters:
roomName, The name of the room.
roomOwner, The room owner name.
maxSize, The maximum number of people the room can handle.
expiresIn, the number of hours for which the room will exist.
However, if I supply a patch to adjust roomName, without also specifying maxSize, then the clientMaxSize that's returned in subsequent GET /rooms/{token} is set to "null".
Reporter | ||
Comment 1•10 years ago
|
||
Actually this bug is slightly worse than I thought - not supplying the roomOwner causes the roomOwner field to no longer be set.
The only thing that appears to be ok is the expiresIn, although I've not tested trying to change that value.
Summary: [Rooms] PATCH /rooms/{token} sets "clientMaxSize" to null if the maxSize parameter is not supplied → [Rooms] PATCH /rooms/{token} doesn't respect optional parameters (overwrites/deletes them in the room data)
Comment 2•10 years ago
|
||
Hi Mark, can you please log the request body you're sending? Are you sending "null" values with the keys? I believe this could be overwriting the data on the server.
Comment 3•10 years ago
|
||
I tried to reproduce the error without success. Can you have a look at tell me if there is something I'm testing badly compared to what you're providing? https://github.com/mozilla-services/loop-server/commit/dc79e33f9aaafcb55c43351b9da7882c6e08603b
Updated•10 years ago
|
Flags: needinfo?(standard8)
Reporter | ||
Comment 4•10 years ago
|
||
The body I'm using is:
{"roomName":"jkljlk"}
The next get for the room comes back as:
{"roomUrl":"http://localhost:3000/content/XNdiFmw2ZlU","roomName":"jkljlk","clientMaxSize":null,"creationTime":1415967507,"expiresAt":1418764491,"ctime":1416172541,"participants":[]}
i.e. clientMaxSize is null, and roomOwner is missing.
Using the part of your patch from your commit (map -> forEach), doesn't seem to fix it.
Flags: needinfo?(standard8)
Comment 5•10 years ago
|
||
I do reproduce with this test. Now fixing in the PR.
Updated•10 years ago
|
Attachment #8525952 -
Flags: review?(alexis+bugs)
Attachment #8525952 -
Flags: feedback?(standard8)
Reporter | ||
Comment 6•10 years ago
|
||
Comment on attachment 8525952 [details] [review]
Link to GitHub PR.
I've just tested against the branch and it seems to be working fine.
Attachment #8525952 -
Flags: feedback?(standard8) → feedback+
Comment 7•10 years ago
|
||
Comment on attachment 8525952 [details] [review]
Link to GitHub PR.
That works for me. Waiting for travis to build correctly and will merge then, thanks!
Attachment #8525952 -
Flags: review?(alexis+bugs) → review+
Comment 8•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [qa?][loop-server 0.14]
You need to log in
before you can comment on or make changes to this bug.
Description
•