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

Join event spam because of unstable URL in reason #267

Closed
MadLittleMods opened this issue Jun 22, 2023 · 0 comments · Fixed by #268
Closed

Join event spam because of unstable URL in reason #267

MadLittleMods opened this issue Jun 22, 2023 · 0 comments · Fixed by #268
Assignees
Labels
T-Defect Something isn't working. Bugs, crashes, or other reported issues.

Comments

@MadLittleMods
Copy link
Contributor

MadLittleMods commented Jun 22, 2023

Join event spam because of unstable URL in reason which means any time it's different, will create a new state event. Depending on how someone views the archive, the reason text will include a different URL.

Example:

Flip-flopping between https://archive.matrix.org/roomid/wOlkWNmgkAZFxbTaqj:matrix.org with the room ID and https://archive.matrix.org/r/raspberrypi:matrix.org with the room alias depending on how the URL is visited.

{
  "content": {
    "displayname": "archive.matrix.org/faq",
    "membership": "join",
    "reason": "Joining room to check history visibility. If your room is public with shared or world readable history visibility, it will be accessible at https://archive.matrix.org/roomid/wOlkWNmgkAZFxbTaqj:matrix.org. See the FAQ for more details: https://github.com/matrix-org/matrix-public-archive/blob/main/docs/faq.md#why-did-the-archive-bot-join-my-room"
  },
  "origin_server_ts": 1687415330265,
  "sender": "@archive:matrix.org",
  "state_key": "@archive:matrix.org",
  "type": "m.room.member",
  "unsigned": {
    "replaces_state": "$wlnRuzw6mTVYvUMkBmHD5jXGROSZglqnzG7ZrRQtmOA",
    "prev_content": {
      "displayname": "archive.matrix.org/faq",
      "membership": "join",
      "reason": "Joining room to check history visibility. If your room is public with shared or world readable history visibility, it will be accessible at https://archive.matrix.org/r/raspberrypi:matrix.org. See the FAQ for more details: https://github.com/matrix-org/matrix-public-archive/blob/main/docs/faq.md#why-did-the-archive-bot-join-my-room"
    },
    "prev_sender": "@archive:matrix.org",
    "age": 2558
  },
  "event_id": "$cyfYrA3MW6w2c44z1_VWNfeRgUko2HkBlTM11EZqB1E",
  "room_id": "!wOlkWNmgkAZFxbTaqj:matrix.org"
}

Potential solutions

It would be nice if we could always use the room ID so it's consistent regardless of the alias someone visits from. But we don't have access to the room ID before we join.

Another simple option is to just remove the URL altogether.

Dev notes

The join reason logic was originally added in #262

@MadLittleMods MadLittleMods added the T-Defect Something isn't working. Bugs, crashes, or other reported issues. label Jun 22, 2023
@MadLittleMods MadLittleMods self-assigned this Jun 22, 2023
MadLittleMods added a commit that referenced this issue Jun 22, 2023
Fix #267

In the case of someone visiting a room via an alias, we can't get access to the `room_id` before we join the room. I've opted to just point to the Matrix Public Archive instance in general. This way the `join` reason is always stable regardless how someone is visiting the room.

Join `reason` was originally added in #262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Defect Something isn't working. Bugs, crashes, or other reported issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant