Skip to content

fix: support domainless room ids of room version 12 - #234

Merged
Benjamin-Loison merged 1 commit into
8go:masterfrom
stas-bool:fix/domainless-room-ids
Nov 4, 2026
Merged

Benjamin-Loison merged 1 commit into
8go:masterfrom
stas-bool:fix/domainless-room-ids

Conversation

@stas-bool

Copy link
Copy Markdown
Contributor

Problem

On homeservers where rooms are created with room version 12 (domainless room ids, no :domain suffix), every send fails:

ERROR: matrix-commander: E151: Message send failed. Sorry.
nio.exceptions.LocalProtocolError: No such room with id !<opaque>:example.com found.

--joined-rooms returns bare ids like !qLztd..., but --room '!qLztd...' --message ... fails.

Domainless room ids are part of room version 12 — see RoomVersionV12 in gomatrixserverlib: registered with domainlessRoomID: true and the comment "v3 versions relax the room ID check as the room ID has no domain now".

Root cause

map_roominfo_to_roomid() treats any !id without a colon as a "short" room id and unconditionally appends :<domain>. Since v12 room ids legitimately have no domain part, the resulting id matches no known room.

Fix

Only append the domain suffix when the bare id is not already present in client.rooms.

Testing

matrix-commander 8.0.6 against a homeserver with default room version 12: E151 before, --message / --tail / --joined-rooms working after. Standard servers unaffected: bare ids never appear in client.rooms there, so suffixing behavior is unchanged.

@Benjamin-Loison

Benjamin-Loison commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for the contribution!

For reference:

gs.log.error("E151: " "Message send failed. Sorry.")

Related to #210.

Personal notes:

On Debian 13 GNOME HP laptop:

matrix_commander/matrix-commander --version
Output:
Traceback (most recent call last):
  File "/home/benjamin_loison/Desktop/bens_folder/dev/git/matrix-commander/matrix_commander/matrix-commander", line 5, in <module>
    from matrix_commander import main
  File "/home/benjamin_loison/Desktop/bens_folder/dev/git/matrix-commander/matrix_commander/matrix_commander.py", line 47, in <module>
    import aiofiles
ModuleNotFoundError: No module named 'aiofiles'
uv venv
Output:
Using CPython 3.12.15
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
source .venv/bin/activate
uv pip install -r requirements.txt 
Output:
Resolved 40 packages in 1.10s
      Built atomicwrites==1.4.1                                                                                                                                                                                          Built uuid==1.30                                                                                                                                                                                             Prepared 20 packages in 1.66s
Installed 40 packages in 20ms
 + aiofiles==25.1.0
 + aiohappyeyeballs==2.7.1
 + aiohttp==3.14.5
 + aiohttp-socks==0.12.0
 + aiosignal==1.4.0
 + async-timeout==5.0.1
 + asyncio==4.0.0
 + atomicwrites==1.4.1
 + attrs==26.1.0
 + cachetools==7.2.8
 + datetime==6.0
 + emoji==2.16.0
 + frozenlist==1.8.0
 + h11==0.16.0
 + h2==4.4.1
 + hpack==4.2.0
 + hyperframe==6.1.0
 + idna==3.20
 + jsonschema==4.26.0
 + jsonschema-specifications==2025.9.1
 + markdown==3.11.2
 + matrix-nio==0.26.0
 + multidict==7.2.1
 + notify2==0.3.1
 + peewee==3.19.0
 + pillow==13.0.0
 + propcache==0.5.4
 + pycryptodome==4.3.0
 + python-magic==0.4.27
 + python-socks==3.2.1
 + pytz==2026.6
 + pyxdg==0.28
 + referencing==0.37.0
 + rpds-py==2026.9.1
 + typing-extensions==4.16.0
 + unpaddedbase64==2.1.0
 + uuid==1.30
 + vodozemac==0.10.0
 + yarl==1.25.1
 + zope-interface==8.7
matrix_commander/matrix-commander --message test
Output:
2026-11-03 17:41:19,607:  WARNING:   nio.crypto.log: Received a undecryptable Megolm event from a unknown device: @benjamin_loison:matrix.org hJ6hM1dUGH
2026-11-03 17:41:19,607:  WARNING:   nio.crypto.log: Error decrypting megolm event, no session found with session id nbKjDUSkEQX5nLqJP+jtmFdno8VqI7fasDBJAKGemtk for room !pdsVekCwcOiaJoleKk:matrix.org
2026-11-03 17:41:19,607:  WARNING:   nio.crypto.log: Received a undecryptable Megolm event from a unknown device: @benjamin_loison:matrix.org 22hodcVQOa
2026-11-03 17:41:19,607:  WARNING:   nio.crypto.log: Error decrypting megolm event, no session found with session id liGfEfGpZRtt+IVfeWKDX4BuRMQzEcPpfKTOP8D1Yic for room !pdsVekCwcOiaJoleKk:matrix.org
2026-11-03 17:41:19,607:  WARNING:   nio.crypto.log: Received a undecryptable Megolm event from a unknown device: @benjamin_loison:matrix.org 22hodcVQOa
2026-11-03 17:41:19,607:  WARNING:   nio.crypto.log: Error decrypting megolm event, no session found with session id liGfEfGpZRtt+IVfeWKDX4BuRMQzEcPpfKTOP8D1Yic for room !pdsVekCwcOiaJoleKk:matrix.org
2026-11-03 17:41:20,547:  WARNING:   nio.crypto.log: Missing session for device 22hodcVQOa
2026-11-03 17:41:20,547:  WARNING:   nio.crypto.log: Missing session for device hJ6hM1dUGH
2026-11-03 17:41:21,770:     INFO: matrix-commander: This message was sent: "test" to room "!pdsVekCwcOiaJoleKk:matrix.org" as event "$BPrY1PS3bdTOYVmWXq7TQKmRId0-DwnO5i6EzURLVc4".
matrix_commander/matrix-commander --message zero
Output:
2026-11-03 17:48:14,524:     INFO: matrix-commander: This message was sent: "zero" to room "!pdsVekCwcOiaJoleKk:matrix.org" as event "$fyeSPU79nQ0Ato5xTUM6TMxAlMO3rx9hW5-lA_bzjMY".
matrix_commander/matrix-commander --message zero --room '!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4'
Output:
2026-11-03 17:48:57,656:    ERROR: matrix-commander: E151: Message send failed. Sorry.
2026-11-03 17:48:57,659:     INFO: matrix-commander: 1 error and 0 warnings occurred.

Default Element desktop Matrix.org room version is now 12.

matrix_commander/matrix-commander --room-join '!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4'
Output:
2026-11-03 17:58:36,822:    ERROR: matrix-commander: E129: join failed with JoinError: M_UNKNOWN No known servers
2026-11-03 17:58:36,824:     INFO: matrix-commander: 1 error and 0 warnings occurred.
matrix_commander/matrix-commander --room-join
Output:
usage: matrix-commander [--usage] [-h] [--manual] [--readme] [-d] [--log-level DEBUG|INFO|WARNING|ERROR|CRITICAL [DEBUG|INFO|WARNING|ERROR|CRITICAL ...]] [--verbose] [--login PASSWORD|SSO] [--verify [EMOJI]]
                        [--logout ME|ALL] [-c CREDENTIALS_FILE] [-s STORE_DIRECTORY] [-r ROOM [ROOM ...]] [--room-default DEFAULT_ROOM] [--room-create ROOM_ALIAS [ROOM_ALIAS ...]]
                        [--room-dm-create USER [USER ...]] [--room-dm-create-allow-duplicates] [--room-join ROOM [ROOM ...]] [--room-leave ROOM [ROOM ...]] [--room-forget ROOM [ROOM ...]]
                        [--room-invite ROOM [ROOM ...]] [--room-ban ROOM [ROOM ...]] [--room-unban ROOM [ROOM ...]] [--room-kick ROOM [ROOM ...]] [-u USER [USER ...]] [--user-login USER]
                        [--name ROOM_NAME [ROOM_NAME ...]] [--topic ROOM_TOPIC [ROOM_TOPIC ...]] [--alias ROOM_ALIAS [ROOM_ALIAS ...]] [-m TEXT [TEXT ...]] [-i IMAGE_FILE [IMAGE_FILE ...]]
                        [-a AUDIO_FILE [AUDIO_FILE ...]] [-f FILE [FILE ...]] [-e MATRIX_JSON_OBJECT [MATRIX_JSON_OBJECT ...]] [-w] [-z] [-k] [-j] [-p SEPARATOR] [--config CONFIG_FILE] [--proxy PROXY] [-n]
                        [--encrypted] [-l [NEVER|ONCE|FOREVER|TAIL|ALL]] [-t [NUMBER]] [-y] [--print-event-id] [--download-media [DOWNLOAD_DIRECTORY]] [--download-media-name SOURCE|CLEAN|EVENTID|TIME]
                        [--os-notify] [--set-device-name DEVICE_NAME] [--set-display-name DISPLAY_NAME] [--get-display-name] [--set-presence ONLINE|OFFLINE|UNAVAILABLE] [--get-presence]
                        [--upload FILE [FILE ...]] [--download MXC_URI [MXC_URI ...]] [--delete-mxc MXC_URI [MXC_URI ...]] [--delete-mxc-before TIMESTAMP [TIMESTAMP ...]] [--joined-rooms]
                        [--joined-members ROOM [ROOM ...]] [--joined-dm-rooms USER [USER ...]] [--mxc-to-http MXC_URI [MXC_URI ...]] [--devices] [--discovery-info] [--login-info] [--content-repository-config]
                        [--rest REST_METHOD DATA URL [REST_METHOD DATA URL ...]] [--set-avatar AVATAR_MXC_URI] [--get-avatar [USER ...]] [--get-profile [USER ...]] [--get-room-info [ROOM ...]]
                        [--get-client-info] [--has-permission ROOM BAN|INVITE|KICK|NOTIFICATIONS|REDACT|etc [ROOM BAN|INVITE|KICK|NOTIFICATIONS|REDACT|etc ...]] [--import-keys FILE PASSPHRASE FILE PASSPHRASE]
                        [--export-keys FILE PASSPHRASE FILE PASSPHRASE] [--room-set-alias ROOM_ALIAS ROOM [ROOM_ALIAS ROOM ...]] [--room-resolve-alias ROOM_ALIAS [ROOM_ALIAS ...]]
                        [--room-delete-alias ROOM_ALIAS [ROOM_ALIAS ...]] [--get-openid-token [USER ...]] [--room-get-visibility [ROOM ...]] [--room-get-state [ROOM ...]] [--delete-device DEVICE [DEVICE ...]]
                        [--room-redact ROOM_ID EVENT_ID REASON [ROOM_ID EVENT_ID REASON ...]] [--whoami] [--no-ssl] [--ssl-certificate SSL_CERTIFICATE_FILE] [--file-name FILE [FILE ...]]
                        [--key-dict KEY_DICTIONARY [KEY_DICTIONARY ...]] [--plain] [--separator SEPARATOR] [--access-token ACCESS_TOKEN] [--password PASSWORD] [--homeserver HOMESERVER_URL]
                        [--device DEVICE_NAME] [--sync FULL|OFF] [-o TEXT|JSON|JSON-MAX|JSON-SPEC] [--room-invites [LIST|JOIN|LIST+JOIN]] [-v [PRINT|CHECK]]
matrix-commander: error: argument --room-join: expected at least one argument

Even after the proposed changes.

matrix_commander/matrix-commander --room-join '!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4' --debug
Output:
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Debug is turned on. debug count=1
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Separator is set to "    " of length 4. E.g. Col1    Col2.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Encryption is always enabled. It cannot be turned off. Use --tail to disable it for specific use cases.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Option --sync is set to full.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: All arguments are valid. All checks passed.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Trying to create a PID file to store process id 242377.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Successfully created PID file "/home/benjamin_loison/.run/matrix-commander.a66a5625-f2a8-4dd5-9f42-5f29abb5a80c.pid" to store process id 242377.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Python version is "3.12.15 (main, Oct 14 2026, 01:05:27) [Clang 23.1.3 ]"
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Stdin pipe is assigned to "none".
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: SSL will be used. Default SSL certificate validation will be done for this connection.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Credentials file does not exist locally. File name has no path.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Trying path "/home/benjamin_loison/.config/matrix-commander/credentials.json" as last resort. Suggesting to look for it there.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: We found the file. It exists in the last resort directory "/home/benjamin_loison/.config/matrix-commander/credentials.json". Suggesting to use this one.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Store was not found in default local directory. But found an existing store directory in "/home/benjamin_loison/.local/share/matrix-commander/store" directory. It will be used.
2026-11-03 18:01:29,188:    DEBUG: matrix-commander: Starting to read credentials file.
2026-11-03 18:01:29,189:    DEBUG: matrix-commander: Finished reading credentials file.
2026-11-03 18:01:29,189:    DEBUG: matrix-commander: About to configure Matrix Async Client.
2026-11-03 18:01:29,189:    DEBUG: matrix-commander: About to initialize Matrix Async Client.
2026-11-03 18:01:29,189:    DEBUG: matrix-commander: About to restore login.
2026-11-03 18:01:29,229:    DEBUG: matrix-commander: Finished restoring login.
2026-11-03 18:01:29,229:    DEBUG: matrix-commander: Login will be using stored credentials from credentials file "/home/benjamin_loison/.config/matrix-commander/credentials.json". room_id = !pdsVekCwcOiaJoleKk:matrix.org, device_id = JKRYMHTBVW, access_token = s***g.
2026-11-03 18:01:29,229:    DEBUG: matrix-commander: About to connect to server to verify connection.
2026-11-03 18:01:29,463:    DEBUG: matrix-commander: restore_login successful. Successfully logged in as user @benjamin_loison_work:matrix.org via restore_login. Response is: WhoamiResponse(uuid='', start_time=None, end_time=None, timeout=0, transport_response=<ClientResponse(https://matrix.org/_matrix/client/v3/account/whoami) [200 OK]>
<CIMultiDictProxy('Date': 'Tue, 03 Nov 2026 15:00:59 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'cloudflare', 'synapse-trace-id': 'ab2767ed30871a4', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, HEAD, POST, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type, Authorization, Date', 'Access-Control-Expose-Headers': 'Synapse-Trace-Id, Server', 'Vary': 'Accept-Encoding', 'Content-Encoding': 'gzip', 'Permissions-Policy': 'interest-cohort=()', 'cf-cache-status': 'DYNAMIC', 'CF-RAY': 'a54c407139d2bb87-CDG')>
, user_id='@benjamin_loison_work:matrix.org', device_id='JKRYMHTBVW', is_guest=False)
2026-11-03 18:01:29,463:    DEBUG: matrix-commander: Preparing to join room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4".
2026-11-03 18:01:29,463:    DEBUG: matrix-commander: Joining room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4:matrix.org".
2026-11-03 18:01:29,765:    ERROR: matrix-commander: E129: join failed with JoinError: M_UNKNOWN No known servers
2026-11-03 18:01:29,765:    DEBUG: matrix-commander: Room action(s) were performed or attempted.
2026-11-03 18:01:29,767:    DEBUG: matrix-commander: The program matrix-commander.py left the event loop.
2026-11-03 18:01:29,767:    DEBUG: matrix-commander: Cleanup: cleaning up.
2026-11-03 18:01:29,767:     INFO: matrix-commander: 1 error and 0 warnings occurred.

If replace:

if ri not in client.rooms:

with:

if False:
matrix_commander/matrix-commander --room-join '!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4' --debug
Output:
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Debug is turned on. debug count=1
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Separator is set to "    " of length 4. E.g. Col1    Col2.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Encryption is always enabled. It cannot be turned off. Use --tail to disable it for specific use cases.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Option --sync is set to full.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: All arguments are valid. All checks passed.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Trying to create a PID file to store process id 242740.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Successfully created PID file "/home/benjamin_loison/.run/matrix-commander.f12217cf-ee81-46c6-b785-21f80a8af690.pid" to store process id 242740.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Python version is "3.12.15 (main, Oct 14 2026, 01:05:27) [Clang 23.1.3 ]"
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Stdin pipe is assigned to "none".
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: SSL will be used. Default SSL certificate validation will be done for this connection.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Credentials file does not exist locally. File name has no path.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Trying path "/home/benjamin_loison/.config/matrix-commander/credentials.json" as last resort. Suggesting to look for it there.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: We found the file. It exists in the last resort directory "/home/benjamin_loison/.config/matrix-commander/credentials.json". Suggesting to use this one.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Store was not found in default local directory. But found an existing store directory in "/home/benjamin_loison/.local/share/matrix-commander/store" directory. It will be used.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Starting to read credentials file.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: Finished reading credentials file.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: About to configure Matrix Async Client.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: About to initialize Matrix Async Client.
2026-11-03 18:02:44,423:    DEBUG: matrix-commander: About to restore login.
2026-11-03 18:02:44,464:    DEBUG: matrix-commander: Finished restoring login.
2026-11-03 18:02:44,464:    DEBUG: matrix-commander: Login will be using stored credentials from credentials file "/home/benjamin_loison/.config/matrix-commander/credentials.json". room_id = !pdsVekCwcOiaJoleKk:matrix.org, device_id = JKRYMHTBVW, access_token = s***g.
2026-11-03 18:02:44,464:    DEBUG: matrix-commander: About to connect to server to verify connection.
2026-11-03 18:02:45,491:    DEBUG: matrix-commander: restore_login successful. Successfully logged in as user @benjamin_loison_work:matrix.org via restore_login. Response is: WhoamiResponse(uuid='', start_time=None, end_time=None, timeout=0, transport_response=<ClientResponse(https://matrix.org/_matrix/client/v3/account/whoami) [200 OK]>
<CIMultiDictProxy('Date': 'Tue, 03 Nov 2026 15:02:15 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Server': 'cloudflare', 'synapse-trace-id': 'e0d7432e02572c2a', 'Cache-Control': 'no-cache, no-store, must-revalidate', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, HEAD, POST, PUT, DELETE, OPTIONS', 'Access-Control-Allow-Headers': 'X-Requested-With, Content-Type, Authorization, Date', 'Access-Control-Expose-Headers': 'Synapse-Trace-Id, Server', 'Vary': 'Accept-Encoding', 'Content-Encoding': 'gzip', 'Permissions-Policy': 'interest-cohort=()', 'cf-cache-status': 'DYNAMIC', 'CF-RAY': 'a54c424b8828c9c2-CDG')>
, user_id='@benjamin_loison_work:matrix.org', device_id='JKRYMHTBVW', is_guest=False)
2026-11-03 18:02:45,491:    DEBUG: matrix-commander: Preparing to join room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4".
2026-11-03 18:02:45,491:    DEBUG: matrix-commander: Joining room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4".
2026-11-03 18:02:46,574:     INFO: matrix-commander: Joined room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4" successfully.
2026-11-03 18:02:46,574:    DEBUG: matrix-commander: Room action(s) were performed or attempted.
2026-11-03 18:02:46,575:    DEBUG: matrix-commander: The program matrix-commander.py left the event loop.
2026-11-03 18:02:46,575:    DEBUG: matrix-commander: Cleanup: cleaning up.
matrix_commander/matrix-commander --message zero --room '!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4'
Output:
2026-11-03 18:03:35,206:     INFO: matrix-commander: This message was sent: "zero" to room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4" as event "$WxYjZXetM7Euhs9qIDT_x-knlv2wcsyRffUuY8LA4e4".
file ~/.local/share/matrix-commander/store/\@benjamin_loison_work\:matrix.org_JKRYMHTBVW.db 
Output:
/home/benjamin_loison/.local/share/matrix-commander/store/@benjamin_loison_work:matrix.org_JKRYMHTBVW.db: SQLite 3.x database, last written using SQLite version 3053001, file counter 6433, database pages 220, 1st free page 220, free pages 1, cookie 0x12, schema 4, UTF-8, version-valid-for 6433
tree -a ~/.local/share/matrix-commander/
Output:
/home/benjamin_loison/.local/share/matrix-commander/
└── store
    ├── @benjamin_loison_work:matrix.org_JKRYMHTBVW.blacklisted_devices
    ├── @benjamin_loison_work:matrix.org_JKRYMHTBVW.db
    ├── @benjamin_loison_work:matrix.org_JKRYMHTBVW.ignored_devices
    └── @benjamin_loison_work:matrix.org_JKRYMHTBVW.trusted_devices

2 directories, 4 files

I quickly browsed the SQL database without finding anything relevant to change the default room.

Searching issues for default, only returns relevantly 8go/matrix-commander/issues/150, which does not help.

`$HOME/.config/matrix-commander/`. When the program looks for

ls -lha ~/.config/matrix-commander/
Output:
total 12K
drwxr-xr-x  2 benjamin_loison benjamin_loison 4.0K Jan 13  2025 .
drwx------ 78 benjamin_loison benjamin_loison 4.0K Nov  3 17:49 ..
-rw-r--r--  1 benjamin_loison benjamin_loison  234 Dec 12  2024 credentials.json

jq . ~/.config/matrix-commander/credentials.json 
Output:
{
  "homeserver": "https://matrix.org",
  "device_id": "JKRYMHTBVW",
  "user_id": "@benjamin_loison_work:matrix.org",
  "room_id": "!pdsVekCwcOiaJoleKk:matrix.org",
  "access_token": "XXX_XXXXXXXXXXXXXXXXXXXXXXXXXXX_XXXXXXXXXXXXXXXXXXXX_XXXXXX"
}

After changing default room to V12, it still works fine.

matrix_commander/matrix-commander --message one
Output:
2026-11-03 18:11:10,172:     INFO: matrix-commander: This message was sent: "one" to room "!reYX21hc5ApdqBuAZ6cMLMlLcWlLPnKxUtFGLFc2qN4" as event "$0cLx8RLn_ZDNx2mZwoXioen4-ccW3uYDS2-8UvADfBo".

Comment thread matrix_commander/matrix_commander.py Outdated
# '!someRoomId'
ri = ri + ":" + default_homeserver(gs.credentials)
# '!someRoomId'; keep room v12 domainless ids as is
if ri not in client.rooms:

@Benjamin-Loison Benjamin-Loison Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This condition breaks --room-join, do you have an idea how to solve this issue?

Room ids are opaque values per spec: room version 12 (MSC4291) generates
ids without the ':domain' suffix. map_roominfo_to_roomid() unconditionally
appended the homeserver domain to any '!id' without a colon, which broke
send and join for v12 rooms (E151 send / E129 join "No known servers").

An incomplete legacy id cannot be told apart from a complete domainless
v12 id, so never append a domain suffix and use the id exactly as
provided. Aliases are still resolved via the homeserver.

Fixes 8go#210
@stas-bool
stas-bool force-pushed the fix/domainless-room-ids branch from baec417 to fa5b59d Compare November 4, 2026 13:32
@Benjamin-Loison
Benjamin-Loison merged commit d4c733c into 8go:master Nov 4, 2026
@Benjamin-Loison

Benjamin-Loison commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

I am doubtful, but have not investigated enough to be sure, that new changes does not let the ability to specify a room before V12 without specifying the domain, but it looks more like a shortcut, than current blocking missing V12 support, so let us merge and investigate further if someone wants the shortcut if the shortcut has an issue.

8go/matrix-commander-rs/pull/278/files#diff-bba68fade136d7c4c2b29f618817321a488200b62d8dd0075ad8792958eaa669R126-R136

could help filter domain add.

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.

2 participants