Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates MensaBot to work with Trixnity 5 / Connect2x package namespace changes and the updated client initialization/auth flow.
Changes:
- Migrate Trixnity imports from
net.folivo.*tode.connect2x.*across handlers/commands. - Update Matrix client creation to the new
MatrixClient.create(...)+classicLogin(...)flow and initializelognitybackend. - Bump
matrix-bot-basedependency to0.16.0-SNAPSHOTand adjust command construction accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/kotlin/org/fuchss/matrix/mensa/handler/command/SubscribeCommand.kt | Updates Trixnity model imports to new namespace. |
| src/main/kotlin/org/fuchss/matrix/mensa/handler/command/ShowCommand.kt | Updates Trixnity imports and message helper import to new namespace. |
| src/main/kotlin/org/fuchss/matrix/mensa/handler/CanteenFormatter.kt | Updates RoomId import to new namespace. |
| src/main/kotlin/org/fuchss/matrix/mensa/Main.kt | Migrates Matrix client startup/auth to Trixnity 5 APIs; sets Lognity backend; updates command wiring. |
| src/main/kotlin/org/fuchss/matrix/mensa/Config.kt | Updates RoomId import to new namespace. |
| pom.xml | Bumps matrix-bot-base to 0.16.0-SNAPSHOT and removes slf4j-simple dependency entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| val existingMatrixClient = MatrixClient.create(createRepositoriesModule(config), createMediaStoreModule(config), createCryptoDriverModule()).getOrNull() | ||
| if (existingMatrixClient != null) { | ||
| return existingMatrixClient | ||
| } |
There was a problem hiding this comment.
MatrixClient.create(...).getOrNull() will silently swallow any exception while opening an existing store (e.g., corrupted DB, incompatible schema). That can cause the bot to fall back to classicLogin and create a new device/session, masking the real failure. Consider handling the Result explicitly (e.g., log and rethrow unexpected errors, and only fall back when the failure indicates “no existing session”).
| .create( | ||
| createRepositoriesModule(config), | ||
| createMediaStoreModule(config), | ||
| createCryptoDriverModule(), |
There was a problem hiding this comment.
createRepositoriesModule(config), createMediaStoreModule(config), and createCryptoDriverModule() are re-created here even though they were just created for the “open existing client” attempt above. If these allocate resources (DB connections, file handles, crypto stores), consider creating them once and reusing them across both paths.
| <groupId>org.fuchss</groupId> | ||
| <artifactId>matrix-bot-base</artifactId> | ||
| <version>${matrix-bot-base.version}</version> | ||
| <version>0.16.0-SNAPSHOT</version> | ||
| </dependency> |
There was a problem hiding this comment.
The dependency on org.fuchss:matrix-bot-base is now pinned to a 0.16.0-SNAPSHOT. Snapshot artifacts can change over time and may disappear from the snapshot repo, making builds non-reproducible. If possible, prefer a released version, or ensure the intended snapshot repository is stable and document why a snapshot is required for this update.



No description provided.