-
Notifications
You must be signed in to change notification settings - Fork 385
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
Proposal for the HTTP API for Client-Server v2 #6
Conversation
…tal initialSync is semantically the same as a long polling eventStream
|
||
set_presence: "offline" // optional parameter to tell the server not to interpret this request as a client as coming online (and as a convenience method for overriding presence state in general) | ||
|
||
presence: true/false (default true): do we want to show presence updates? |
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.
You mention presence, but what about typing? What about other ephemeral details we might one day invent?
…ence), better and more accurate examples for /sync and friends, rename 'chunk' to be 'batch', specify mx:// URLs and more...
All of leo's concerns above should now have been addressed (albeit mainly because the comments referred to the prior incarnation of the presence semantics). The core functionality here (Sync, Scrollback, Context APIs and Actions) should now be complete and good for implementing as alpha. Any other concerns, please voice them here asap. |
Sync
I think these choices of values are going to be confusing. The format for events that get sent to the client (for the most part) is a subset of keys that are sent over federation. Due to all the signing that goes on I always think of the federation event format to be canonical, while the (current) c-s format is simply a stripped down version. My suggestions are "full" and "stripped"/"partial"/"collapsed" or something like that. At the very least can we change the value "events" to something else so that its clear that the stripped down versions of events are not the canonical format? ScrollbackThe scrollback API doesn't seem to have a way of indicating the various states it could be in when returning less than the limit:
|
Otherwise, looks OK. |
Can we |
On 22/01/2015 16:49, Kegsay wrote:
filter_id not filter_token as the token doesn't change between uses of |
Okay, that seems reasonable. We do reserve the right for home servers to expire filter ids, but it should be infrequent enough to not be confusing. |
To represent events as "{event}" and not "event_id: {event}", given these events do not appear in any event map (since they aren't tied to a room and hence are never prone to duplication in events/state).
// N.B. This only takes effect when paginating, and is ignored for streaming data, and can only be specified once per filter. | ||
// | ||
// the sort order of messages in the room, *only honoured during an initial sync*. default: "timeline,asc". may appear multiple times | ||
// subsequent calls to /sync will always return event updates in timeline order (thanks to causality) |
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.
This should say "return event updates in the order they arrive at the server" rather than "timeline order". Since timeline order is different from the arrival ordering.
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.
done
From earlier on #matrix-dev:
This concept needs to be added to the HTTP spec. The use case being the web client: I want to display the 10 most recent displayable events, but I want to receive all the different event types evar so I can populate the state events dialog, which currently you can't do. |
I guess this could be done as two /sync requests, one for displayable events limit 10, and another for the current state (limit 0?). The main downside to what I suggested above is that there is an indeterminate amount of events between the most recent 10 displayable events and "now" potentially. |
Surely the problem here is that we want may want total state for the room (which can't be paginated currently), but only 10 visible events. limit=10 would never apply to state anyway, so how about having two filter params - one specifically for state, and the other specifically for general timeline events? |
That could work. I could then say |
in spec-3 we defined non-state events to be called messages. instead i suggest events_filter or timeline_filter or even graph_filter?
|
Should control over what state is filtered and what events are filtered be part of the filter itself? Rather than having two filters. Especially if we are using the filter to control what format the events are in given that the event_map contains both events from the state and from the recent events. |
Given these are events which appear in the
My gut reaction originally said "no, the filter just controls which events are obtained and how each event is represented (eg which keys), not room related stuff". However, there is already a precedent for modifying global/room stuff via
Which would end up with rather satisfyingly symmetric filter request keys/sync response keys:
Do we want public/private user data to just be bools at this point? If they are, which filter is applied when I say |
Should we be specifying separate lists for public/private user data as well rather than true/false?
|
That looks good to me. This way you know exactly what you're filtering on for each key in We need to work out the semantics for |
Can we please have a better way of differentiating types of events than this? An absence of a |
More than happy with mjarkegan's suggestion above; my bad for not proposing it in the first place. |
I think Erik is complaining that we have lost the ability for servers to send messages to a client outside of a room. |
So the outstanding problems on this are:
The general API mentions that there should be a prefix to the event type to indicate state/message/ephemeral event. We currently determine the different kinds of events based on the keys e.g.
This covers all the different kinds of events which exist (or are planned to exist in the future):
This would negate the need to prefix event types since you can tell what kind of event it is based on the key it is inside of. For sending those event types, you hit different CS endpoints e.g. |
On 28/01/2015 15:41, Kegsay wrote:
wfm |
kegan: the last commit doesn't seem entirely complete - don't we need ephemeral blocks on the response for /sync too? And do we have a way to distinguish ephemeral non-room data from non-ephemeral? |
What's the use case?
When would we want ephemeral non-room data? It's a lot easier to add these fields in at a later date, but very difficult to remove them if they turn out to be duds, hence prompting for use cases. |
…st of the file should be bold
At this point the comments in the PR are more valuable than the actual change itself. The change isn't going to land in its current form, so we'll close this PR. Ideal next steps from here (with sufficient round tuits) would be:
|
https://github.com/matrix-org/matrix-doc/blob/client_server_v2_http_api/drafts/cs-v2-http-api.rst