Skip to content
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

Skip room join until we run into a 403 Forbidden and peek into world_readable rooms #272

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Jun 23, 2023

Skip room join until we run into a 403 Forbidden and peek into world_readable rooms

Previously, 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 a 403 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 a world_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 is world_readable even over federation.

This would prevent joins for rooms on any servers that support MSC3266.

Todo

  • Add tests
  • The FAQ might need some slight adjustments

Before, it would swallow all of the errors and just return empty data
which was fine but now we want it to retry fetching if we weren't in
the room yet so we need that 403 error being thrown signal.
@MadLittleMods MadLittleMods added T-Enhancement New feature or request A-archive-room-view The view to look at a room day by day in the archive A-backend Related to the backend Node.js server pieces labels Jun 23, 2023
@MadLittleMods MadLittleMods changed the title Optimistically use Matrix API's and show world readable rooms Skip room join until we run into a 403 Forbidden and peek into world_readable rooms Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-archive-room-view The view to look at a room day by day in the archive A-backend Related to the backend Node.js server pieces T-Enhancement New feature or request
Projects
None yet
1 participant