Closed JuniorJPDJ closed 1 year ago
Same here, on a fresh install w/ double puppets, and even after unbridging, no DMs backfill due to self.first_event_id not being initialized :(
Using MSC2716 backfill is currently not recommended, and it's not going to work on rooms created before the feature was added.
It seems the log spam should have been caught with your work on commit a23f17f , but it seems it doesn't cover all code paths yet - I was looking into this just now 🙂
Using MSC2716 backfill is currently not recommended, and it's not going to work on rooms created before the feature was added.
Oh so it's an issue with MSC2716 ! Makes sense then, thanks for the heads-up !
EDIT : Adding for posterity that this affects DMs backfill only and not groups
Have looked it this some more. The issue (might not be the original poster's) is unrelated to MSC2716.
The root cause appears to be a failure to create the first_event_id; it is never set - an exception is returned instead because the bridge bot is not in the room. I'm still familiarizing myself with the code, but it seems that the bot is deliberately not being invited (only the puppets are, unless encryption is enabled as default), and that should have been done by the puppet.
I'll continue to look into this later, and hopefully make a PR if I figure it out. Any pointers regarding the expected design would be appreciated. Otherwise: Enabling encryption by default in the bridge config is a viable workaround - No log spams, backfilling works, etc.
Here's a log when initializing the rooms :
[...]Failed to create portal[...]
2023-03-18T16:40:28.957153118Z mautrix.errors.request.MForbidden: You are not invited to this room.
2023-03-18T16:40:28.957158118Z
2023-03-18T16:40:28.957163918Z The above exception was the direct cause of the following exception:
2023-03-18T16:40:28.957158118Z
2023-03-18T16:40:28.957174818Z Traceback (most recent call last):
2023-03-18T16:40:28.957180418Z File "/usr/lib/python3.10/site-packages/mautrix_facebook/portal.py", line 589, in create_matrix_room
2023-03-18T16:40:28.957198319Z return await self._create_matrix_room(source, info)
2023-03-18T16:40:28.957205319Z File "/usr/lib/python3.10/site-packages/mautrix_facebook/portal.py", line 726, in _create_matrix_room
2023-03-18T16:40:28.957211119Z self.first_event_id = await self.az.intent.send_message_event(
2023-03-18T16:40:28.957216419Z File "/usr/lib/python3.10/site-packages/mautrix/appservice/api/intent.py", line 140, in wrapper
2023-03-18T16:40:28.957221819Z await __self.ensure_joined(room_id)
2023-03-18T16:40:28.957227819Z File "/usr/lib/python3.10/site-packages/mautrix/appservice/api/intent.py", line 587, in ensure_joined
2023-03-18T16:40:28.957233319Z raise IntentError(f"Failed to join room {room_id} as {self.mxid}") from e
2023-03-18T16:40:28.957240219Z mautrix.errors.base.IntentError: Failed to join room ![REDACTED] as @facebookbot:[REDACTED]
Nice catch @tulir . The same issue (and quick fix) can be seen here as well https://github.com/mautrix/facebook/blob/fa7f67db2f442630683bcf44435a93324cc16eea/mautrix_facebook/portal.py#L1039
Likely L1213 too for the read receipts
My log is spammed with messages like this (portal ID changes) and I suspect backfill is not happening in other chats due to that - I tried scheduling backfill on other chat and nothing happened in a few days.