Skip to content

fix: route all Matrix configs through build_matrix_messenger#168

Merged
rexlunae merged 1 commit intomainfrom
devin/1776124291-fix-matrix-password-bypass
Apr 13, 2026
Merged

fix: route all Matrix configs through build_matrix_messenger#168
rexlunae merged 1 commit intomainfrom
devin/1776124291-fix-matrix-password-bypass

Conversation

@devin-ai-integration
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot commented Apr 13, 2026

Summary

Removes the "matrix" if config.access_token.is_none() arm from generic_messenger_config, which was intercepting password-based Matrix configurations and routing them through GenericMessenger. This caused build_matrix_messenger — and its setup of state_dir, allowed_chats, and dm_config — to be silently skipped for password-auth Matrix users.

After this change, all Matrix configs (both access_token and password-based) go through build_matrix_messenger, which already handles both auth modes (lines 360-378 in the current file).

This addresses the unresolved Devin Review finding on PR #167.

Review & Testing Checklist for Human

  • Verify MatrixMessenger (password path) is a full replacement for GenericMessenger wrapping chat_system_config::MatrixConfig: The old code created a GenericMessenger for password-based Matrix; the new code creates a MatrixMessenger via build_matrix_messenger. Confirm there are no behaviors in GenericMessenger that MatrixMessenger lacks (e.g., reconnection logic, error handling differences).
  • Test password-based Matrix login end-to-end: Configure a Matrix messenger with password (no access_token) and verify: (1) login succeeds, (2) sync token persists across restarts, (3) allowed_chats filtering works, (4) dm_config is respected.
  • Test access_token-based Matrix login still works: Ensure no regression for the path that was already going through build_matrix_messenger.

Notes

  • The rustyclaw-core crate compiles cleanly with --features matrix. The two warnings present (unused_imports in ssh.rs, unused_variables in mod.rs) are pre-existing and unrelated.

Link to Devin session: https://app.devin.ai/sessions/0599369f847f4741a17b8026ac897dc4
Requested by: @rexlunae


Open with Devin

Remove the 'matrix' arm from generic_messenger_config that intercepted
password-based Matrix configs and routed them through GenericMessenger.
This caused state_dir, allowed_chats, and dm_config setup to be silently
skipped for password-auth Matrix users.

Now all Matrix configs (both access_token and password) go through
build_matrix_messenger, which already handles both auth modes and
correctly applies state_dir, allowed_chats, and dm_config.

Fixes Devin Review finding on PR #167.

Co-Authored-By: Erica Stith <rexlunae@gmail.com>
@devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@rexlunae rexlunae merged commit 2d58fd6 into main Apr 13, 2026
14 checks passed
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.

1 participant