Closed Bug 1067384 Opened 10 years ago Closed 10 years ago

[Rooms] Handle multiple simple push urls at registration time

Categories

(Hello (Loop) :: Server, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: alexis+bugs, Unassigned)

References

Details

(Whiteboard: [qa?])

Attachments

(1 file)

56 bytes, text/x-github-pull-request
alexis+bugs
: review+
tarek
: feedback+
Details | Review
https://wiki.mozilla.org/Loop/Architecture/Rooms#Loop_Server_API_Changes states that we should have multiple SP urls at registration time.
So the proposed API is: POST /registration HTTP/1.1 Accept: application/json Content-Type: application/json; charset=utf-8 Host: localhost:5000 { "callsSimplePushURL": "https://example.org/wg0asg83t_74s", "roomsSimplePushURL": "https://example.org/vnd7a85ls9gh" } Today's API is POST /registration HTTP/1.1 Accept: application/json Content-Type: application/json; charset=utf-8 Host: localhost:5000 { "simplePushURL": "https://example.org/wg0asg83t_74s" } I would like to make it looks like: POST /registration HTTP/1.1 Accept: application/json Content-Type: application/json; charset=utf-8 Host: localhost:5000 { "simplePushURL": "https://example.org/wg0asg83t_74s", "simplePushURLs": { "calls": "https://example.org/vnd7a85ls9gh", "rooms": "https://example.org/mvc_9834dser" } } The idea behind that is to keep the current simplePushURL parameter to no break the API and use it as the default one if provided. But also let the user define different SimplePushURLs per channels and let the ability in the future to add more channels. So the simplePushURL will be optional and if provided used as the default SimplePushURL for all topics. If the simplePushURLs is provided, topic inside will be set. If one topic is missing a 400 error will be raised. Does this would work for you?
Flags: needinfo?(alexis+bugs)
Flags: needinfo?(adam)
I mixed channels and topics for the same thing, also I think we should use topics in the future because channel are already used to define something else in loop-server.
Whiteboard: [qa?]
Blocks: 1067971
(In reply to Rémy Hubscher (:natim) from comment #1) > So the proposed API is: > > POST /registration HTTP/1.1 > Accept: application/json > Content-Type: application/json; charset=utf-8 > Host: localhost:5000 > > { > "callsSimplePushURL": "https://example.org/wg0asg83t_74s", > "roomsSimplePushURL": "https://example.org/vnd7a85ls9gh" > } > > Today's API is > > POST /registration HTTP/1.1 > Accept: application/json > Content-Type: application/json; charset=utf-8 > Host: localhost:5000 > > { > "simplePushURL": "https://example.org/wg0asg83t_74s" > } > > I would like to make it looks like: > > POST /registration HTTP/1.1 > Accept: application/json > Content-Type: application/json; charset=utf-8 > Host: localhost:5000 > > { > "simplePushURL": "https://example.org/wg0asg83t_74s", > "simplePushURLs": { > "calls": "https://example.org/vnd7a85ls9gh", > "rooms": "https://example.org/mvc_9834dser" > } > } > > The idea behind that is to keep the current simplePushURL parameter to no > break the API and use it as the default one if provided. > > But also let the user define different SimplePushURLs per channels and let > the ability in the future to add more channels. > > So the simplePushURL will be optional and if provided used as the default > SimplePushURL for all topics. > If the simplePushURLs is provided, topic inside will be set. > > If one topic is missing a 400 error will be raised. > > Does this would work for you? Sure, that seems reasonable. I'll update the wiki page when I get a moment (which might not be right away; this week will be pretty busy for me). Just to make sure we have a common understanding of how this works: simplePushURL and simplePushURLs.call should have the same value. Is that what you expect also?
Flags: needinfo?(adam)
Yes I have updated the wiki page: https://wiki.mozilla.org/Loop/Architecture/Rooms#Loop_Server_API_Changes So basically if simplePushURL is provided, it will be used as simplePushURLs.calls
Attachment #8490074 - Flags: review?(alexis+bugs)
Attachment #8490074 - Flags: feedback?(tarek)
Flags: needinfo?(alexis+bugs)
Yes, that works for me, I prefer this way of dealing with it.
Attachment #8490074 - Flags: feedback?(tarek) → feedback+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment on attachment 8490074 [details] [review] Link to Github PR — #207 clearing the r? on myself. This landed already.
Attachment #8490074 - Flags: review?(alexis+bugs) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: