You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// no push rules for guests, no access to POST filter for guests.
returnthis.doSync({});
}
It's reasonable to ignore saved filter IDs here, because guests can't save filters. But I think guests can use literal JSON filters in /sync – when I run the following with a guest access token against a Synapse server, I get the sync response with the room's events:
curl -X GET 'https://myserver.com/_matrix/client/r0/sync?filter=%7B%22room%22%3A%7B%22rooms%22%3A%5B%22%21IFwaPwKWSVQuKFbDZQ%3Amyserver.com%22%5D%7D%7D' \
-H 'Authorization: Bearer <guest_token>'
I would like to use the built-in client syncing so that I can use existing code interacting with the client's store (e.g. client.getRoom()) when accessing a single world_readable room as a guest (the concrete feature is a "web public room," like view.matrix.org but in-browser).
I couldn't find anything in the spec that says JSON filters should not be usable by guests. Would this be a welcome change?
The text was updated successfully, but these errors were encountered:
I filed too soon – the response from the mentioned /sync call does not include events from the allowlisted room, which indicates to me that JSON filters are not supported for guests. (I checked this by running the same request using a non-guest access token which has access to the specified room, which gave me back a list of the events I expected.)
For anyone coming here from a search (#998 hints that, at least as of 2019, there has been confusion around use of matrix-js-sdk with guest access), I ended up using client.peekInRoom + the existing client store accessors like client.getRoom(), which appears to be working well.
Filters passed to
startClient
are ignored whenclient.isGuest()
:matrix-js-sdk/src/sync.ts
Lines 730 to 733 in 2ef7ae7
It's reasonable to ignore saved filter IDs here, because guests can't save filters. But I think guests can use literal JSON filters in
/sync
– when I run the following with a guest access token against a Synapse server, I get the sync response with the room's events:I would like to use the built-in client syncing so that I can use existing code interacting with the client's store (e.g.
client.getRoom()
) when accessing a singleworld_readable
room as a guest (the concrete feature is a "web public room," like view.matrix.org but in-browser).I couldn't find anything in the spec that says JSON filters should not be usable by guests. Would this be a welcome change?
The text was updated successfully, but these errors were encountered: