Updated to 0.0.2. Fixed "invalid room" bug

`2026-matrix-csonac` (it uses this package) failed to send messages to the room after bot restart. The problem would go away if the bot received some message in the room it was trying to send a message to. This commit fixes the problem.
- Added `load_store` (issue #1)
- Added `full_state=True` to sync_forever
This commit is contained in:
2026-09-02 13:54:55 +03:00
parent c3046307c7
commit d41b588adc
2 changed files with 4 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "mab"
version = "0.0.1"
version = "0.0.2"
authors = [
{ name = "Tyukalov Nikita", email = "nikita@tyukalov.su" }
]

View File

@@ -263,6 +263,7 @@ class MatrixBot:
user_id=username,
**session_data
)
self._client.load_store()
result = await self._client.whoami()
if type(result) is WhoamiError:
self._logger.error(f"Can't log in using stored session data: '{result.message}'")
@@ -369,7 +370,8 @@ class MatrixBot:
sync_task = asyncio.create_task(
self._client_cancellable_sync_forever(
timeout=self.MATRIX_SYNC_PERIOD,
since=(await self._read_next_batch())
since=(await self._read_next_batch()),
full_state=True
)
)
try: