Properly pass accounts into pickle

This commit is contained in:
Astra Logical 2026-07-23 14:09:12 -04:00
parent 2582e69e3a
commit dab9bae8f7

View file

@ -429,14 +429,14 @@ async def main():
"device_id": client.device_id
}, f)
# Ensure an Olm crypto account exists in the store BEFORE initializing OlmMachine
account = await crypto_store.get_account()
# Ensure an Olm crypto account exists in the store for this specific mxid BEFORE initializing OlmMachine
account = await crypto_store.get_account(client.mxid)
if not account:
log.info("Creating new Olm account...")
account = OlmAccount()
await crypto_store.put_account(account)
await crypto_store.put_account(account, client.mxid)
# Initialize OlmMachine after the account is guaranteed to exist
# Initialize OlmMachine after the account is guaranteed to exist under the correct key
client.crypto = OlmMachine(client, crypto_store, state_store)
# Register Event Handlers