-
Notifications
You must be signed in to change notification settings - Fork 7
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
An Alternative (WebSockets) Design #97
Comments
AFAIK once the client gets the source of notifications (in this case WebSocket) the client can re-establish the connection without re-subscribing. We might consider in a separate issue if notification sources can expire and the subscription response should include that information. |
I have not seen this specified in the standard, and always assumed that secured endpoints are for one time/limited use. There has to be some expiry, one cannot expect a server to remember endpoints it has doled out for eternity. I agree, this needs a separate issue.... |
Discovery resources are cacheable. That is the nature of resources retrieved via GET |
Thank you for following up on the discussion. I would like to offer my perspective:
Well, those are 3 (cacheable) requests prior to establishing a notification (which is the one you always will have).
I believe this is a subscription-type-specific question. In the case of Web Push, for example, this is already decided by the used standards and does not pose a question. (It is one channel per client).
I believe this is websocket related? At least I am not aware that "re-negotiating a new endpoint" is a thing, at least in "my subscription type world". I would expect a client to simply open a new one with the already discovered enpoint (and optionally to end the old subscription). That's one (or two) requests.
When features supported by the server are discovered beforehand, there is no need for feature negotiation.
This is specific to the websocket subscription type.
Again, I believe this question is websocket specific?
I would prefer a standard flow that is universally used across subscription types to discover and establish a subscription. Things that make me ponder For me, the main point of discussion here is how discovery and establishing a subscription works. While I can (maybe) imagine that in specific cases it is more performant to use websockets for discovery and establishing a subscription,
Maybe someone with more experience with websockets has a different perspective on this and I appreciate their wisdom. |
Just some minor follow-ups on @uvdsl 's detailed reply:
It would be very confusing to the consumer to have different sub-protocols with completely different approaches to notifications within the same protocol. I would argue that in cases of such significant divergences, they should really be treated as different protocols under the same branding.
I think we mean the same thing here. One would have to request the discovery resource for a new endpoint and then open a new connection using that (and optionally close the old connection), which is just more work for the client (than working on a single connection). That's all I mean't by renegotiating (cut me some slack since I am not from a CS background).
Ideally, I am with you on this one! But if there is a disproportionate use of one method (and I expect there to be), optimizing for that one method might become more important than symmetry. Perf is important to user experience.
I see the real benefit of WebSockets, not with the current protocol, which is read-centric, but when it shall inevitably be extended to read-write (which one will just have to, if the potential of Solid is to be realized). I mean clients notifying servers, instead of using something like This is a personal view, one that might even be unpopular, but the focus with Solid should be on the long game, not how we can improve the web now, but what the web should actually be in the coming decades.
Another unpopular and biased view: The aim should always be to minimize client complexity, even if it makes life harder for server implementers (the only exception being a cost prohibitive encumbrance). Ultimately, it is the client experience that drives adoption.
Can we not just use the same semantics for notification (or even build upon them)! |
@acoburn gave me a lengthy explanation for the design choices, in particular, for why authentication is better handled out of band using the HTTP infrastructure. I am still fuzzy on many issues surrounding the protocol, especially around the access and management of multiple resources simultaneously (which is the bread and butter concern of a client). But at least I understand the motivation behind the design choices. My only request is that these reasons must be documented alongside the protocol spec (rather than spread across issues and trapped in implementers' minds), so that people who contribute to and use the protocol have an understanding of why these design choices have been made. Once that is done, I shall be happy to close the issue. |
As discussed after the meeting last week (7 July 2022), I would like to propose an alternate design for Solid Notifications.
Before I even begin, a few disclaimers are in order:
Background
The current Solid Notification Protocol requires a number of discovery and initialization steps before we can actually start receiving any notifications:
These are clearly a lot of round-trips before we can actually start receiving notifications.
My other concern is with Internet outages (especially micro-outages), which are extremely common where I live (even on broadband, let alone mobile). Going through even an extra step to recover a disrupted WebSocket connection is going to lead to a poor user experience.See @acoburn comment below.Further, it is not specified yet, if we shall have one channel per resource or one channel per client. Even in the latter case (one channel per client), if the client wants to add or remove resources and/or change notification features like extend subscription duration, it must re-negotiate a new endpoint first using HTTP. While this might be necessary for uni-directional protocols, it makes little sense to carry this over to a bi-directional protocol like WebSockets.
Proposal
GET
to multiple resources on a Solid pod and with an endless response)a. The server may close the connection due to a failure to authenticate.
b. The server may re-negotiate features.
c. The server starts sending notifications (perhaps the first message contains an 'accept').
Changes of features, addition or removal of resources can all be done in band through a client message, without the need to initiate new connections.
Even if we choose to go with one channel per resource, the operation is no more complex than a new connection &
GET
like request.Benefits
@uvdsl already has a symmetry objection to this proposal. While I have hinted at it already, I shall defer to him for a full explanation.
I also invite other Subscription Type authors to consider how their proposals may be affected.
The text was updated successfully, but these errors were encountered: