Wait for exp_discord_auth with plugins.waitFor

Clusterio 2.1.2 loads plugins concurrently and lets them wait for each
other, so exp_discord_sync gets exp_discord_auth in its entrypoint and
attaches the link hooks there instead of looking it up on the first
sync. Without exp_discord_auth it logs an error and does not connect.

DiscordAuth.get() and its WeakMap had no other users and are removed,
the README shows waitFor instead. The sync tests load both plugins
through lib.PluginLoader with sync listed first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-11-23 16:28:00 +00:00
1 parent 2c55cb796e
commit cf968c02bb
5 files changed
+60 -52

No files matched your search

-9
View File
@@ -295,15 +295,6 @@ t.test("api for other plugins", t2 => {
return calls;
}
t2.test("static get() returns the plugin loaded on a controller", async t3 => {
const { plugin, controller } = await startPlugin(t3);
t3.equal(ControllerPlugin.get(controller), plugin);
const other = new Controller(logger, [], new lib.ControllerConfig("controller", {
"controller.database_directory": t3.testdir(),
}));
t3.equal(ControllerPlugin.get(other), undefined);
});
t2.test(".getLink(), .getAccount() and .getAccounts() read links", async t3 => {
const { plugin } = await startPlugin(t3);
const session = await discordLogin(plugin, alice);