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

deleting messages causes problems in encrypted rooms #8

Open
williamkray opened this issue Oct 28, 2023 · 0 comments
Open

deleting messages causes problems in encrypted rooms #8

williamkray opened this issue Oct 28, 2023 · 0 comments

Comments

@williamkray
Copy link
Owner

in an encrypted room with threaded-responses disabled, if i delete any message in the recent history the bot has trouble capturing the messages to use for context.

the following is an example from the logs of my testing instance:

[06:24:01](file:////opt/maubot/maubot/matrix.py:287)WARNING[client/@clorg:jobmachine.org](https://maubot.dev.jobmachine.org/#/client/@clorg:jobmachine.org)/cryptoget_event: Failed to decrypt $P5iiCx8v3WAsdfeD8tyGrIO-PQPUo3BjKY5yHV5tyv0: Unsupported event content class
[06:24:01](file:////data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py:107)ERROR[instance/gpt](https://maubot.dev.jobmachine.org/#/instance/gpt)Something went wrong: Decryption error!
[06:24:01](file:////data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py:107)ERROR[instance/gpt](https://maubot.dev.jobmachine.org/#/instance/gpt)Traceback (most recent call last):
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 91, in on_message
    context = await self.get_context(event)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 176, in get_context
    async for next_event in self.generate_context_messages(event):
  File "/data/plugins/org.jobmachine.chatgpt-v0.0.8-ts1698499308976.mbp/gpt.py", line 216, in generate_context_messages
    raise ValueError("Decryption error!")
ValueError: Decryption error!

workarounds include sending a message with enough words in it to push the deletion event far enough back to not be included in the context, or enable threads in the bot temporarily until this naturally happens.

in the meantime, it is strongly advised to avoid deleting messages in encrypted rooms.

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

1 participant