polychatproject / polychat-appservice

A Matrix AppService to connect people via Polychats
https://www.polychat.de
GNU Affero General Public License v3.0
0 stars 1 forks source link

Roompool does not provide rooms. #10

Closed yncyrydybyl closed 5 months ago

yncyrydybyl commented 5 months ago

It looks like the rooms are created. But they are not provides when the user wants to join.

yncyrydybyl commented 5 months ago
Feb 07 21:13:57 alpha matrix-appservice-polychat[2287053]: bb25bdba156a86aa1e8582cd9c8be2f2b1b83a26fe73c402d7d727523143550a
Feb 07 21:13:58 alpha systemd[1]: Started matrix-appservice-polychat.service - Matrix Appservice polychat bridge.
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: IRC_BRIDGE_MXID undefined
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: SIGNAL_BRIDGE_MXID undefined
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: TELEGRAM_BRIDGE_MXID @telegrambot:polychat.de
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: WHATSAPP_BRIDGE_MXID undefined
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: AppService: Listening on 0.0.0.0:9998
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: Called fillUpSubRoomPool
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: fillUpSubRoomPool: MXID for irc not defined
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: Sub Room Pool: Creating 2 sub rooms for telegram
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: Called createSubRoom {
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]:   network: "telegram",
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: }
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: Called createSubRoom {
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]:   network: "telegram",
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: }
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: fillUpSubRoomPool: MXID for signal not defined
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: fillUpSubRoomPool: MXID for whatsapp not defined
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: API: Listening on 0.0.0.0:9999
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: createSubRoom: Invite DEBUG_MXID to !HLOqvkLXAOUTwyPynb:polychat.de
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: createSubRoom: Invite DEBUG_MXID to !qrBoSBkyjvSAMpuIxt:polychat.de
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: createSubRoom: Invite TELEGRAM_BRIDGE_MXID to !qrBoSBkyjvSAMpuIxt:polychat.de
Feb 07 21:13:59 alpha matrix-appservice-polychat[2287089]: createSubRoom: Invite TELEGRAM_BRIDGE_MXID to !HLOqvkLXAOUTwyPynb:polychat.de
Feb 07 21:14:00 alpha matrix-appservice-polychat[2287089]: createSubRoom: Set power level of TELEGRAM_BRIDGE_MXID to 50 in !HLOqvkLXAOUTwyPynb:polychat.de
Feb 07 21:14:00 alpha matrix-appservice-polychat[2287089]: createSubRoom: Set power level of TELEGRAM_BRIDGE_MXID to 50 in !qrBoSBkyjvSAMpuIxt:polychat.de
Feb 07 21:14:00 alpha matrix-appservice-polychat[2287089]: createSubRoom: Invite TELEGRAM_BRIDGE_TUG_MXID to !qrBoSBkyjvSAMpuIxt:polychat.de
Feb 07 21:14:00 alpha matrix-appservice-polychat[2287089]: createSubRoom: Invite TELEGRAM_BRIDGE_TUG_MXID to !HLOqvkLXAOUTwyPynb:polychat.de
Feb 07 21:14:00 alpha matrix-appservice-polychat[2287089]: createSubRoom: Join as TELEGRAM_BRIDGE_TUG_MXID to !HLOqvkLXAOUTwyPynb:polychat.de
Feb 07 21:14:00 alpha matrix-appservice-polychat[2287089]: createSubRoom: Join as TELEGRAM_BRIDGE_TUG_MXID to !qrBoSBkyjvSAMpuIxt:polychat.de
Feb 07 21:14:04 alpha matrix-appservice-polychat[2287089]: Appservice Processing transaction 20163
Feb 07 21:14:04 alpha matrix-appservice-polychat[2287089]: Appservice Processing event of type m.room.create
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: room.event {"age":90,"content":{"displayname":"testuser","membership":"invite"},"event_id":"$b8vWaTRm-clBaAwzQFwzuThhdegiIqJJMFG_o8Cd5Xc","origin_server_ts":1707337865123,"room_id":"!wJjFuPFQIZuJSOavzp:polychat.de","sender":"@polychat:polychat.de","state_key":"@testuser:polychat.de","type":"m.room.member","unsigned":{"age":90},"user_id":"@polychat:polychat.de"}
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: Appservice - - - [07/Feb/2024:20:31:05 +0000] "PUT /_matrix/app/v1/transactions/20356? HTTP/1.1" - - "-" "Synapse/1.99.0"
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: API: Created Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: Appservice Processing transaction 20357
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: Appservice Processing event of type m.room.power_levels
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: room.event {"age":75,"content":{"ban":50,"events":{"m.room.avatar":50,"m.room.canonical_alias":50,"m.room.encryption":100,"m.room.history_visibility":100,"m.room.name":50,"m.room.power_levels":100,"m.room.server_acl":100,"m.room.tombstone":100},"events_default":0,"historical":100,"invite":0,"kick":50,"redact":50,"state_default":50,"users":{"@polychat:polychat.de":100,"@testuser:polychat.de":50},"users_default":0},"event_id":"$J--Yn7szCzm0jfVOkneYP7dCjU9rgaHWpJfbFZZHBfM","origin_server_ts":1707337865230,"prev_content":{"ban":50,"events":{"m.room.avatar":50,"m.room.canonical_alias":50,"m.room.encryption":100,"m.room.history_visibility":100,"m.room.name":50,"m.room.power_levels":100,"m.room.server_acl":100,"m.room.tombstone":100},"events_default":0,"historical":100,"invite":0,"kick":50,"redact":50,"state_default":50,"users":{"@polychat:polychat.de":100},"users_default":0},"replaces_state":"$wLi13IzWRX19lR1Mb0UmUdPZHil4v-fVgjxAnxKV6rg","room_id":"!wJjFuPFQIZuJSOavzp:polychat.de","sender":"@polychat:polychat.de","state_key":"","type":"m.room.power_levels","unsigned":{"age":75,"prev_content":{"ban":50,"events":{"m.room.avatar":50,"m.room.canonical_alias":50,"m.room.encryption":100,"m.room.history_visibility":100,"m.room.name":50,"m.room.power_levels":100,"m.room.server_acl":100,"m.room.tombstone":100},"events_default":0,"historical":100,"invite":0,"kick":50,"redact":50,"state_default":50,"users":{"@polychat:polychat.de":100},"users_default":0},"prev_sender":"@polychat:polychat.de","replaces_state":"$wLi13IzWRX19lR1Mb0UmUdPZHil4v-fVgjxAnxKV6rg"},"user_id":"@polychat:polychat.de"}
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: Appservice - - - [07/Feb/2024:20:31:05 +0000] "PUT /_matrix/app/v1/transactions/20357? HTTP/1.1" - - "-" "Synapse/1.99.0"
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:05 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:37 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:37 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:54 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:54 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:57 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:31:57 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:32:09 alpha matrix-appservice-polychat[2287089]: API: Requested Polychat !wJjFuPFQIZuJSOavzp:polychat.de
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: API: Error claiming a sub room for !wJjFuPFQIZuJSOavzp:polychat.de for telegram
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: 156 |     if (!Array.isArray(unclaimedSubRoomsForThisNetwork)) {
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: 157 |         throw Error('E_NO_SUB_ROOM_FOR_THIS_NETWORK');
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: 158 |     }
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: 159 |     const subRoomIndex = unclaimedSubRoomsForThisNetwork.findIndex(subRoom => subRoom.ready && subRoom.inviteUrl);
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: 160 |     if (subRoomIndex === -1) {
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: 161 |         throw Error('E_OUT_OF_SUB_ROOMS');
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:                     ^
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]: error: E_OUT_OF_SUB_ROOMS
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at /app/src/index.ts:161:15
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at claimSubRoom (/app/src/index.ts:154:36)
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at /app/src/api.ts:136:33
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at /app/src/api.ts:100:90
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at handle (/app/node_modules/express/lib/router/layer.js:95:5)
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at next (/app/node_modules/express/lib/router/route.js:144:7)
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at done (/app/node_modules/multer/lib/make-middleware.js:45:7)
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at indicateDone (/app/node_modules/multer/lib/make-middleware.js:49:68)
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at /app/node_modules/multer/lib/make-middleware.js:166:7
Feb 07 21:32:18 alpha matrix-appservice-polychat[2287089]:       at emitCloseNT (node:stream:1405:49)
jaller94 commented 5 months ago

It does create the sub rooms but never marks them as ready because it does not see the inite link messages.

jaller94 commented 5 months ago

Maybe fixed in f3d84e94925753b4960a2705ffad681617814b07.

I incorrectly tested for msgtype === 'notice' when it should have been msgtype === 'm.notice'. This is now slightly better covered by a unit test.

jaller94 commented 5 months ago

Tested and fixed