-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
When starting the bot built with the matrix-bot-sdk, an error occurs due to a mismatch between the user_id and device_id.
During the sync process, you’ll see this error message:
Thu, 13 Mar 2025 22:22:01 GMT [ERROR] [MatrixHttpClient] (REQ-3) {
'@botName:example.com': {
'-fmeqAf3': {
error: 'user_id or device_id mismatch: users: - @botName:example.com, devices: - -fmeqAf3'
}
}
}
code:
import {
AutojoinRoomsMixin, ICryptoStorageProvider,
LogLevel,
LogService,
MatrixClient,
RichConsoleLogger, RustSdkCryptoStorageProvider,
SimpleFsStorageProvider
} from "matrix-bot-sdk";
import * as path from "path";
import config from "./config.js";
LogService.setLogger(new RichConsoleLogger());
LogService.setLevel(LogLevel.DEBUG);
LogService.muteModule("Metrics");
LogService.info("index", "Bot starting...");
(async function () {
const storage = new SimpleFsStorageProvider(path.join(config.dataPath, "bot.json"));
const cryptoStore = new RustSdkCryptoStorageProvider(path.join(config.dataPath, "encrypted"));
const client = new MatrixClient(config.homeserverUrl, config.accessToken, storage, cryptoStore);
if (config.autoJoin) {
AutojoinRoomsMixin.setupOnClient(client);
}
LogService.info("index", "Starting sync...");
await client.start();
})();
Metadata
Metadata
Assignees
Labels
No labels