matrix-org / matrix-appservice-irc

Node.js IRC bridge for Matrix
Apache License 2.0
460 stars 149 forks source link

Please enable "allowUnconnectedMatrixUsers" in #test:matrix.org #1722

Closed ilmari closed 1 year ago

ilmari commented 1 year ago

#test:matrix.org (aka #matrix-test on LiberaChat) would be much more useful for testing if it didn't constantly get set to "blocked": true, disabling IRC -> Matrix messages, because of IRC membership sync issues.

Half-Shot commented 1 year ago

image

This appears to be the case already?

ilmari commented 1 year ago

I'm not seeing that state event at all in the devtools, neither on my own homeserver nor on matrix.org.

Screenshot from 2023-05-16 11-17-56

However, am seeing it in the events and state_events tables on my homeserver, but not in current_state_events:

ilmari@[local]:5432 synapse=> select * from current_state_events
    where room_id = '!AUyclzjhyJPgZJeNkW:matrix.org'
    and type like 'org.matrix.appservice-irc.%' \gx
┌─[ RECORD 1 ]──────────────────────────────────────────────┐
│ event_id   │ $ad9Gw-gH4Ia5U4F_h7XKXA7sIPwYjmkR3GMmSKhMSvg │
│ room_id    │ !AUyclzjhyJPgZJeNkW:matrix.org               │
│ type       │ org.matrix.appservice-irc.connection         │
│ state_key  │ irc.libera.chat #matrix-test                 │
│ membership │                                              │
└────────────┴──────────────────────────────────────────────┘

ilmari@[local]:5432 synapse=> select event_id, type, state_key, to_timestamp(origin_server_ts/1000.0) ts
    from events where room_id = '!AUyclzjhyJPgZJeNkW:matrix.org' 
    and type like 'org.matrix.appservice-irc.%';
┌──────────────────────────────────────────────┬──────────────────────────────────────┬──────────────────────────────┬────────────────────────────┐
│                   event_id                   │                 type                 │          state_key           │             ts             │
├──────────────────────────────────────────────┼──────────────────────────────────────┼──────────────────────────────┼────────────────────────────┤
│ $4zEeSgECz2fj1S-0ug3VPqivLlXOE-ZibqAxhpBrtOs │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-11-15 18:21:30.524+00 │
│ $JXoQ7BIivCSO3FtFwOPV7b71id3bq_edgqMJB_2kidM │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-11-18 16:42:15.65+00  │
│ $cyhIIqIOjYE1PXG_C6UkPQWORgTL8N-EnHMZofL2vHo │ org.matrix.appservice-irc.config     │                              │ 2022-02-01 12:33:59.266+00 │
│ $WevD57fpKOTbn6D6Gcjirx81VX5aYzTchYLsy1SPLxU │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2022-07-18 07:57:10.562+00 │
│ $2UHx8tPkxsAKZzTXauaI6c2MsugnAKVcZZbjUJtg9Xw │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-06-28 11:04:10.262+00 │
│ $0D-Luw8J_N6OzRncg7llphQ_gxBZ2Uz31z8Ubn6Ix3k │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-07-02 23:06:41.76+00  │
│ $ippKCdUSgjJyB5pjf7c5TgEqxgWQvELXKZS0iO0D02k │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-07-02 23:37:51.256+00 │
│ $QxlcI33MvE3viVj7cij3IAdt1wEd5ISoJntSTCSZ3Ns │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-07-08 09:53:01.8+00   │
│ $uiiGZFKKACNEPGYbfMrTImEGm6VGPEqzK88Ez-lA9UA │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2022-07-18 07:59:21.07+00  │
│ $nyX7tBsZq66m6pnfPXbtAmN1gEpo0hNTsKtfzGop_uU │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2022-09-09 16:58:39.196+00 │
│ $5KRgR-QpNAY3O-BuuJZwiQhJK7gk1pApPEE-3lN6OLY │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-06-08 17:10:20.513+00 │
│ $BZq1CeqbXny_R3whoHIZJKVxUOhurRuaDWQxIWvgZko │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-10-01 12:39:58.023+00 │
│ $6wvmfX_XGJfMUvpWz4OqOv1XZXAVTm-jU275ECC8TQk │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-07-06 08:18:50.552+00 │
│ $fJr97-4OQU9PGZ3NB6pimst_iGtjLdzEfG0YQXNoXe4 │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-06-15 18:41:50.932+00 │
│ $X57YgcGMDuxJ6SBkqrV5HVK23t5jhFB4kBT4gj1F-LI │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2022-05-23 19:35:39.194+00 │
│ $tXDJVXS8tjRIKXOKqBTeBOGtalww-_2_Ftje8bLr0QU │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-06-10 17:37:34.279+00 │
│ $vY84e3e2e6IMxoC8BuYmyRIKY_XybM_GglnK4YxhYTc │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2021-06-11 03:09:10.55+00  │
│ $rrO3regjphS5cNkW7MjRwz5LuWELO3pFf5fDHkpKoyA │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2023-02-07 15:53:56.252+00 │
│ $ad9Gw-gH4Ia5U4F_h7XKXA7sIPwYjmkR3GMmSKhMSvg │ org.matrix.appservice-irc.connection │ irc.libera.chat #matrix-test │ 2023-03-14 13:02:32.881+00 │
└──────────────────────────────────────────────┴──────────────────────────────────────┴──────────────────────────────┴────────────────────────────┘
(19 rows)

ilmari@[local]:5432 synapse=> select jsonb_pretty(json::jsonb) from event_json
    where event_id ='$cyhIIqIOjYE1PXG_C6UkPQWORgTL8N-EnHMZofL2vHo'\gx
┌─[ RECORD 1 ]─┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ jsonb_pretty │ {                                                                                                                     ↵│
│              │     "type": "org.matrix.appservice-irc.config",                                                                       ↵│
│              │     "depth": 20316,                                                                                                   ↵│
│              │     "hashes": {                                                                                                       ↵│
│              │         "sha256": "C6ogpvVxb5jkJcq3rJ5tc4RPrtyO47nJXZrFyo/iA+g"                                                       ↵│
│              │     },                                                                                                                ↵│
│              │     "origin": "half-shot.uk",                                                                                         ↵│
│              │     "sender": "@Half-Shot:half-shot.uk",                                                                              ↵│
│              │     "content": {                                                                                                      ↵│
│              │         "allowUnconnectedMatrixUsers": true                                                                           ↵│
│              │     },                                                                                                                ↵│
│              │     "room_id": "!AUyclzjhyJPgZJeNkW:matrix.org",                                                                      ↵│
│              │     "unsigned": {                                                                                                     ↵│
│              │         "age_ts": 1643718839266                                                                                       ↵│
│              │     },                                                                                                                ↵│
│              │     "state_key": "",                                                                                                  ↵│
│              │     "prev_state": [                                                                                                   ↵│
│              │     ],                                                                                                                ↵│
│              │     "signatures": {                                                                                                   ↵│
│              │         "half-shot.uk": {                                                                                             ↵│
│              │             "ed25519:a_fBAF": "JJdSzkeKCzjkt7Y4vizbKFZPCyxOsLA5DunzCqosZDOFn8pQFt0c1a8+UbwsGbyjUmsZLvFyN3dWHFMtAMKLBg"↵│
│              │         }                                                                                                             ↵│
│              │     },                                                                                                                ↵│
│              │     "auth_events": [                                                                                                  ↵│
│              │         "$odzXmQxEaCSBphK5klwIghV0kfHx1m05-sz09d9KzXA",                                                               ↵│
│              │         "$dmxkaWRMpyCpILT3NbRyZJqBVCj1R3LXEmEctKqvmEc",                                                               ↵│
│              │         "$M28X8w3mY6nkrv5whuk0QHFnd_rBhvKfnhJWl72MNOE"                                                                ↵│
│              │     ],                                                                                                                ↵│
│              │     "prev_events": [                                                                                                  ↵│
│              │         "$9IE_Nn4V-1BsZ8krf0DklZV5Gkq-O-6awJ-4wlWxfLA"                                                                ↵│
│              │     ],                                                                                                                ↵│
│              │     "origin_server_ts": 1643718839266                                                                                 ↵│
│              │ }                                                                                                                      │
└──────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

ilmari@[local]:5432 synapse=> select * from state_events
    where event_id ='$cyhIIqIOjYE1PXG_C6UkPQWORgTL8N-EnHMZofL2vHo'\gx
┌─[ RECORD 1 ]──────────────────────────────────────────────┐
│ event_id   │ $cyhIIqIOjYE1PXG_C6UkPQWORgTL8N-EnHMZofL2vHo │
│ room_id    │ !AUyclzjhyJPgZJeNkW:matrix.org               │
│ type       │ org.matrix.appservice-irc.config             │
│ state_key  │                                              │
│ prev_state │                                              │
└────────────┴──────────────────────────────────────────────┘

And the bridge doesn't seem to be seeing it either, because the org.matrix.appservice-irc.connection state event still has "blocked": true

ilmari@[local]:5432 synapse=> select jsonb_pretty(json::jsonb)
    from current_state_events cse join event_json ej using (room_id, event_id)
    where cse.room_id = '!AUyclzjhyJPgZJeNkW:matrix.org'
    and cse.type like 'org.matrix.appservice-irc.%' \gx
┌─[ RECORD 1 ]─┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ jsonb_pretty │ {                                                                                                                     ↵│
│              │     "type": "org.matrix.appservice-irc.connection",                                                                   ↵│
│              │     "depth": 26766,                                                                                                   ↵│
│              │     "hashes": {                                                                                                       ↵│
│              │         "sha256": "IAvWhAItOKr5rrIj8NuaKr62GiE6JPOMufNa3r9/IZA"                                                       ↵│
│              │     },                                                                                                                ↵│
│              │     "origin": "libera.chat",                                                                                          ↵│
│              │     "sender": "@appservice:libera.chat",                                                                              ↵│
│              │     "content": {                                                                                                      ↵│
│              │         "blocked": true                                                                                               ↵│
│              │     },                                                                                                                ↵│
│              │     "room_id": "!AUyclzjhyJPgZJeNkW:matrix.org",                                                                      ↵│
│              │     "unsigned": {                                                                                                     ↵│
│              │         "replaces_state": "$rrO3regjphS5cNkW7MjRwz5LuWELO3pFf5fDHkpKoyA"                                              ↵│
│              │     },                                                                                                                ↵│
│              │     "state_key": "irc.libera.chat #matrix-test",                                                                      ↵│
│              │     "signatures": {                                                                                                   ↵│
│              │         "libera.chat": {                                                                                              ↵│
│              │             "ed25519:t4fjCr": "jHhK9E9gEr4yhcjIjeFpu8yIe5Kp3rK4riGP9ZbDsj0IEy2D443ff9muWsfVqWHzfad7G9zoOHQ6MJW9ejXlAQ"↵│
│              │         }                                                                                                             ↵│
│              │     },                                                                                                                ↵│
│              │     "auth_events": [                                                                                                  ↵│
│              │         "$lFdmjFeRpFYcsAamxRYcFJ2TRQaY4R2rA59E0ZmyW9o",                                                               ↵│
│              │         "$WLNDpHffTdFkwXZdUZb-H3t6fNzGWFju2USg4q8HNko",                                                               ↵│
│              │         "$M28X8w3mY6nkrv5whuk0QHFnd_rBhvKfnhJWl72MNOE"                                                                ↵│
│              │     ],                                                                                                                ↵│
│              │     "prev_events": [                                                                                                  ↵│
│              │         "$raT9y1_HBtNubyXRHwyaMJWj73VRM-Va80u1hTPfpHc"                                                                ↵│
│              │     ],                                                                                                                ↵│
│              │     "origin_server_ts": 1678798952881                                                                                 ↵│
│              │ }                                                                                                                      │
└──────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Half-Shot commented 1 year ago

I've just resent another event, anyway.

ilmari commented 1 year ago

I can see the config event now, and it's working in both directions, even though the connection state event still says blocked: true.