-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Matrix Badges - "guests not allowed" #10776
Comments
Badge tested using |
Looking at the examples you've posted, these are all for rooms hosted on matrix.org This isn't the case for all matrix servers though. For example, these badges (using different matrix servers) work just fine
although I am aware that matrix.org is by far the most common choice of server so this upstream change breaks the majority matrix badges. In general, the method the matrix badges use to get stats is not very good for performance reasons outlined in #10138 even where guest access is available. Moving to the solution outlined in that issue would solve this problem and also provide performance benefits. One of the reasons nobody worked on that is because it is a bit fiddly to deal with different matrix servers out there running different versions of the software. I wonder if enough time has passed that we could simplify the implementation by just dropping the old guest access method and say you now must have the summary endpoint to use the badge. That would simplify things a bit. |
Thanks Chris, that makes sense. I wondered if we could use the same method https://matrix.to/#/#flashdim:matrix.org uses to preview the room user number. Turns out, they use the mentioned summary endpoint as well: I would say it makes sense to adopt this new method now and drop the guest access for older rooms / homeservers. |
But then again I wonder how https://app.element.io/#/room/#flashdim:matrix.org fetches the user number without the summary call |
OK. So just having done a bit more reading on it, it looks like:
Given that, I think it is too soon to drop the existing method and require the summary endpoint. Doing that would probably fix badges for matrix.org users but break it for a lot of other users. Annoyingly, I think we would ideally need to able to use both methods at this stage. |
Someone on Matrix mentioned that apparently shields.io got blocked on matrix.org: Furthermore, guest access doesn't seem to be disabled for matrix.org |
That's exciting. Matrix badges are cached downstream for 30 seconds shields/services/matrix/matrix.service.js Line 84 in bf91e26
but we could, of course, increase that. |
It should be increased a lot I feel like. If so, we could easily say a cache of 1 day would still be enough. I mean the number of users is not a sensitive stat that has to be up-to-date permanently. |
Yeah looking back at it, I think the person who originally contributed this probably copied this from the discord badge, which shows the number of users online right now. The matrix badge just shows the number of channel members. There's less need for this to be fresh. We tend not to cache things for as long as a day, but I've submitted a PR bumping it to 4 hours at #10778 . That's 480 times longer than we were caching it previously. Whether or not that gets us unbanned is another issue but caching for longer is something we can do quickly and easily. Either way, the ability to optionally use the summary endpoint would be an improvement for other reasons. |
Sounds good. Do you think the logic should be adjusted for now to fetch the summary for matrix.org and for every other server the current logic? |
Yes. I think using the summary endpoint for matrix.org only would be a simpler first step and would solve a lot of problems. My hunch is that most of the rooms large enough for the current method to present a performance problem are going to be on matrix.org. Are you interested in submitting a PR? Side note: the PR increasing the cache length has been deployed. |
I agree. Actually I have already implemented it yesterday. I have not enabled it for the matrix.org by default, I have added an additional parameter "fetchMode" with values "guest" (default) or "summary". Should I submit it like that or should I change it to make it default for matrix.org and ignore the endpoint for every other homeserver? |
I think lets make it the default for matrix.org but not expose fetchMode as a URL param for now |
Let me quickly explain my thought: If you're a homeserver owner you may want to be able to reduce load on your server. My idea would be to enable it by default for matrix.org but still offer a param to overwrite the default for matrix.org or for other homeservers. But if you say you prefer your way, I will do that. |
If we're going to expose it as a param:
|
Are you experiencing an issue with...
shields.io
🐞 Description
The badges for Matrix rooms all show the same error, "guests not allowed".
It started coming up a few weeks ago I would say.
I've noticed it on my repo: https://github.com/cyb3rko/flashdim
But here are some more examples:
🔗 Link to the badge
https://img.shields.io/matrix/flashdim%3Amatrix.org?logo=matrix&label=Matrix%20Chat&color=black
💡 Possible Solution
No response
The text was updated successfully, but these errors were encountered: