Skip room join until we run into a 403 Forbidden
and peek into world_readable
rooms
#272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Skip room join until we run into a
403 Forbidden
and peek intoworld_readable
roomsPreviously, we would try to join the room no matter what. Now with this PR, we assume that we are already joined to the room or can peek in the
world_readable
case and only if we get a403 Forbidden
, do we go back and try to join the room.This has the effect of the Matrix Public Archive being able to serve content from
world_readable
rooms without joining (peeking). And in the case of aworld_readable
room needing invites, will still work (see case mentioned in #271).This prevents the archive bot from joining a room if the server already knows about. We need to join as a fallback no matter what because it's not possible to peak or glean information about a room over federation without joining.
Fix #50
Fix #271
Also related to this discussion in
#matrix-public-archive:matrix.org
Going further
In order to solve the federated peeking problem to see if a room is
world_readable
, we could use MSC3266 room summaries to check whether the room isworld_readable
even over federation.This would prevent joins for rooms on any servers that support MSC3266.
Todo