Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Fix appservice EDUs failing to send if the EDU doesn't have a room ID #13236

Merged
merged 4 commits into from Jul 11, 2022

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Jul 9, 2022

As is in the case of presence.

Fixes this error:

element-dev-stack-eledev-synapse-1      | 2022-07-09 02:04:50,721 - synapse.metrics.background_process_metrics - 242 - ERROR - as-sender-encrypted_appservices-13 - Background process 'as-sender-encrypted_appservices' threw an exception
element-dev-stack-eledev-synapse-1      | Traceback (most recent call last):
element-dev-stack-eledev-synapse-1      |   File "/usr/local/lib/python3.9/site-packages/twisted/internet/defer.py", line 1660, in _inlineCallbacks
element-dev-stack-eledev-synapse-1      |     result = current_context.run(gen.send, result)
element-dev-stack-eledev-synapse-1      | StopIteration: 504208
element-dev-stack-eledev-synapse-1      | 
element-dev-stack-eledev-synapse-1      | During handling of the above exception, another exception occurred:
element-dev-stack-eledev-synapse-1      | 
element-dev-stack-eledev-synapse-1      | Traceback (most recent call last):
element-dev-stack-eledev-synapse-1      |   File "/usr/local/lib/python3.9/site-packages/synapse/metrics/background_process_metrics.py", line 240, in run
element-dev-stack-eledev-synapse-1      |     return await func(*args, **kwargs)
element-dev-stack-eledev-synapse-1      |   File "/usr/local/lib/python3.9/site-packages/synapse/appservice/scheduler.py", line 274, in _send_request
element-dev-stack-eledev-synapse-1      |     ) = await self._compute_msc3202_otk_counts_and_fallback_keys(
element-dev-stack-eledev-synapse-1      |   File "/usr/local/lib/python3.9/site-packages/synapse/appservice/scheduler.py", line 321, in _compute_msc3202_otk_counts_and_fallback_keys
element-dev-stack-eledev-synapse-1      |     rooms_of_interesting_users.update(
element-dev-stack-eledev-synapse-1      |   File "/usr/local/lib/python3.9/site-packages/synapse/appservice/scheduler.py", line 322, in <genexpr>
element-dev-stack-eledev-synapse-1      |     ephemeral["room_id"] for ephemeral in ephemerals
element-dev-stack-eledev-synapse-1      | KeyError: 'room_id'

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request includes a changelog file. The entry should:
    • Be a short description of your change which makes sense to users. "Fixed a bug that prevented receiving messages from other servers." instead of "Moved X method from EventStore to EventWorkerStore.".
    • Use markdown where necessary, mostly for code blocks.
    • End with either a period (.) or an exclamation mark (!).
    • Start with a capital letter.
    • Feel free to credit yourself, by adding a sentence "Contributed by @github_username." or "Contributed by [Your Name]." to the end of the entry.
  • Pull request includes a sign off
  • Code style is correct
    (run the linters)

@turt2live turt2live marked this pull request as ready for review July 9, 2022 02:20
@turt2live turt2live requested a review from a team as a code owner July 9, 2022 02:21
@squahtx
Copy link
Contributor

squahtx commented Jul 11, 2022

I think this bug has existed since the implementation of MSC3202 in #11617.

Copy link
Contributor

@squahtx squahtx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@DMRobertson
Copy link
Contributor

Complement failures look like known flakes. Going to manually merge.

@DMRobertson DMRobertson merged commit a113011 into develop Jul 11, 2022
@DMRobertson DMRobertson deleted the travis/fix-edu-roomid-error-appservices branch July 11, 2022 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants