Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example: Pass Jabber ID or bare Jabber ID to class StorageImpl(Storage): #4

Open
sjehuda opened this issue Nov 20, 2024 · 1 comment

Comments

@sjehuda
Copy link

sjehuda commented Nov 20, 2024

For the example file, I think, that it would be beneficial to pass Jabber ID or bare Jabber ID to class StorageImpl(Storage): and name the filename as [email protected]

JSON_FILE = f"/home/syndace/{jid_bare}-omemo-echo-client.json"

This would prevent errors when utilizing a bot if Jabber ID is replaced.

future: <Task finished name='Task-19' coro=<XEP_0384.get_session_manager() done, defined at /home/admin/.venv/lib/python3.12/site-packages/slixmpp_omemo/xep_0384.py:648> exception=RuntimeError('coroutine raised StopIteration')>
Traceback (most recent call last):
  File "/home/admin/.venv/lib/python3.12/site-packages/omemo/session_manager.py", line 1492, in get_own_device_information
    return next(iter(all_own_devices - other_own_devices)), other_own_devices
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/admin/.venv/lib/python3.12/site-packages/slixmpp_omemo/xep_0384.py", line 666, in get_session_manager
    session_manager = await self.__session_manager_task
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/slixmpp_omemo/xep_0384.py", line 479, in _prepare
    session_manager = await _make_session_manager(xmpp, xep_0384).create(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/admin/.venv/lib/python3.12/site-packages/omemo/session_manager.py", line 432, in create
    device, _ = await self.get_own_device_information()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: coroutine raised StopIteration
ERROR    Error handling {jabber:client}message stanza
Traceback (most recent call last):
  File "/home/admin/.venv/lib/python3.12/site-packages/omemo/session_manager.py", line 1492, in get_own_device_information
    return next(iter(all_own_devices - other_own_devices)), other_own_devices
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

@sjehuda sjehuda changed the title Pass Jabber ID or bare Jabber ID to class StorageImpl(Storage): Example: Pass Jabber ID or bare Jabber ID to class StorageImpl(Storage): Nov 20, 2024
@Syndace
Copy link
Owner

Syndace commented Jan 25, 2025

Thanks for you suggestion, I agree that would be nice. The problem is that JIDs are not always path/file-name safe, so it's not that simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants