8go / matrix-commander-rs

simple but convenient CLI-based Matrix client app for sending and receiving (in Rust)
GNU General Public License v3.0
79 stars 2 forks source link

Bug: Room alias instead of full room id in credentials file #5

Closed MatthiasGrandl closed 1 year ago

MatthiasGrandl commented 1 year ago
RUST_BACKTRACE=FULL matrix-commander-rs -m "test"  
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: MissingLeadingSigil', src/mclient.rs:1959:45
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

same command works just fine with the python implementation

8go commented 1 year ago

Clearly a problem. Thanks @MatthiasGrandl for reporting. I cannot reproduce it.

a) which version are you running? 0.1.20? b) how did you create the credentials file? with matrix-commander-rs --login ... or are you using a credentials file created with Python?

Also run it with --debug to get more info. The problem looks like it is missing the default room specified at login.

Ok, I just looked at the code. I think I know what causes the problem. Please confirm that you are using a credentials file created with the Python version of matrix-commander? Correct?

8go commented 1 year ago

@MatthiasGrandl please try version v0.1.21 which should be online in about 90 minutes.

And please report back with a) confirming you were using a Python-created credentials file and b) if this fixes it.

MatthiasGrandl commented 1 year ago

Currently not at the desk, but no I separately logged in on both python and rust version. And I built from master at the time I posted the issue.

Will try the updated version when I am home, thanks.

8go commented 1 year ago

No rush.

to summarize: you have 2 different credential files (one from Py, another one from Rust), correct? This is perfectly ok, just trying to understand your setup.

Later, whenever you have time:

After installing/creating v0.1.21 run it with -v. You will get some instructions to modify your Rust-created credentials file manually by replacing room-default with room_id. Do that first, What is the value of the key room_id in the credentials file? Does it start with a !?

Then run with --debug and see which credential file it picks up and reads. Also check to which value the rooms list for -m is set to.

We take it from there.

MatthiasGrandl commented 1 year ago

It works now. I think the problem is that as room-default I had a room alias instead of ID, which I guess was never supported on the rust version? Anyway I updated, changed the room-default key to room_id and switched it to the proper room id and now it works.

8go commented 1 year ago

Yes, I guess in Py it accepts alias and in Rust it doesn't. I'll add an alias-to-full-id conversion to Rust.

8go commented 1 year ago

v.0.1.22 to be released tomorrow or the next day will be able to handle aliases in the credentials file.

But for performance reasons it is nonetheless recommended to put the full room id into the credentials file (instead of a room alias).