Skip to content

discord: Properly paginate through all users#198

Merged
poVoq merged 1 commit intomatterbridge-org:masterfrom
timschumi:discord-user-paginate-org
Apr 3, 2026
Merged

discord: Properly paginate through all users#198
poVoq merged 1 commit intomatterbridge-org:masterfrom
timschumi:discord-user-paginate-org

Conversation

@timschumi
Copy link
Copy Markdown

Fetching one page with 1000 users on it is not going to be enough for some servers.

@poVoq
Copy link
Copy Markdown
Collaborator

poVoq commented Apr 1, 2026

What is the effect of this right now before the patch?

@timschumi
Copy link
Copy Markdown
Author

What is the effect of this right now before the patch?

The first (effectively random) 1000 Discord users can be pinged by name from other platforms, the others can not be pinged by name (because their user information is not in the list). By extension, every use of that list that assumes that the list is complete will be broken.

@soliton-
Copy link
Copy Markdown

soliton- commented Apr 2, 2026

The check is failing because of a formatting issue. You can run go fmt ./... yourself to fix it or apply this diff:

diff --git a/bridge/discord/discord.go b/bridge/discord/discord.go
index 29375c3..5c0c7b8 100644
--- a/bridge/discord/discord.go
+++ b/bridge/discord/discord.go
@@ -227,7 +227,7 @@ func (b *Bdiscord) Connect() error {
                                b.nickMemberMap[member.Nick] = member
                        }
                }
-               after = members[len(members) - 1].User.ID
+               after = members[len(members)-1].User.ID
        }
        
        b.c.AddHandler(b.messageCreate)

(With PR #196 merged you could see the diff in the CI logs.)

@timschumi timschumi force-pushed the discord-user-paginate-org branch from 07121d2 to b286571 Compare April 3, 2026 01:22
@poVoq
Copy link
Copy Markdown
Collaborator

poVoq commented Apr 3, 2026

Looks good now. Can you still add a changelog entry for it please?

@timschumi timschumi force-pushed the discord-user-paginate-org branch from b286571 to 06cc34c Compare April 3, 2026 13:55
@timschumi timschumi force-pushed the discord-user-paginate-org branch from 06cc34c to 79e97a0 Compare April 3, 2026 13:56
@poVoq poVoq merged commit 48a53b8 into matterbridge-org:master Apr 3, 2026
7 checks passed
@timschumi timschumi deleted the discord-user-paginate-org branch April 3, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants