Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Generate real events when we reject invites #7804

Merged
merged 6 commits into from
Jul 9, 2020

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 8, 2020

Fixes #2181.

The basic premise is that, when we fail to reject an invite via the remote server, we can generate our own out-of-band leave event and persist it as an outlier, so that we have something to send to the client.

Probably easiest to review this commit-by-commit.

@richvdh richvdh changed the base branch from master to develop July 8, 2020 15:06
@richvdh richvdh force-pushed the rav/remote_reject_invite branch 4 times, most recently from 2f727ca to 2982b92 Compare July 8, 2020 16:51
richvdh added 5 commits July 8, 2020 17:52
we had the same thing in two places; I don't think there's any need for this.
Rather than passing the room id, user id, remote host, etc, just pass over the
id of the invite event we're trying to reject. It's more powerful and more
concise.
This is the core change which fixes #2181. The basic premise is that, when we
fail to reject an invite via the remote server, we can generate our own
out-of-band leave event and persist it as an outlier, so that we have something
to send to the client.

This makes the old `locally_reject_invite` impl redundant; a future commit will
remove it.
... and the `ReplicationEndpoint` which implemented it over federation.

Now superceded by `RoomMemberMaseterHandler._locally_reject_invite`
@richvdh richvdh force-pushed the rav/remote_reject_invite branch from 2982b92 to 15105b8 Compare July 8, 2020 16:52
@richvdh richvdh marked this pull request as ready for review July 8, 2020 16:53
@richvdh richvdh requested a review from a team July 8, 2020 16:53
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

I think the code looks good, but I'm not confident in my understanding of ramifications of leaving that event as an outlier.

synapse/handlers/room_member.py Outdated Show resolved Hide resolved
Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

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

I think we talked through the pieces I was unsure about!

@richvdh richvdh merged commit 2ab0b02 into develop Jul 9, 2020
@richvdh richvdh deleted the rav/remote_reject_invite branch July 9, 2020 09:40
anoadragon453 added a commit that referenced this pull request Jul 20, 2020
…anoa/amorgan.xyz

* 'release-v1.17.0' of github.com:matrix-org/synapse: (117 commits)
  1.17.0
  update changelog
  fix migration, again
  fix changelog
  1.16.1
  Drop incorrectly-added table `local_rejections_stream`. (#7816)
  1.17.0rc1
  Fix some spelling mistakes / typos. (#7811)
  `update_membership` declaration: now always returns an event id. (#7809)
  Improve stacktraces from exceptions in background processes (#7808)
  Fix `can only concatenate list (not "tuple") to list` exception (#7810)
  Pass original request headers from workers to the main process. (#7797)
  Generate real events when we reject invites (#7804)
  Add `HomeServer.signing_key` property (#7805)
  Revert "Update the installation docs on apt-transport-https (#7801)"
  Do not use simplejson in Synapse. (#7800)
  Stop passing bytes when dumping JSON (#7799)
  Update the installation docs on apt-transport-https (#7801)
  shuffle changelog slightly
  1.16.0
  ...
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit '43726783e': (22 commits)
  1.17.0rc1
  Fix some spelling mistakes / typos. (#7811)
  `update_membership` declaration: now always returns an event id. (#7809)
  Improve stacktraces from exceptions in background processes (#7808)
  Fix `can only concatenate list (not "tuple") to list` exception (#7810)
  Pass original request headers from workers to the main process. (#7797)
  Generate real events when we reject invites (#7804)
  Add `HomeServer.signing_key` property (#7805)
  Revert "Update the installation docs on apt-transport-https (#7801)"
  Do not use simplejson in Synapse. (#7800)
  Stop passing bytes when dumping JSON (#7799)
  Update the installation docs on apt-transport-https (#7801)
  shuffle changelog slightly
  Change Caddy links (old is deprecated) (#7789)
  Stop populating unused table `local_invites`. (#7793)
  Refactor getting replication updates from database v2. (#7740)
  Add libwebp dependency to Dockerfile (#7791)
  Add documentation for JWT login type and improve sample config. (#7776)
  Convert the appservice handler to async/await. (#7775)
  Don't ignore `set_tweak` actions with no explicit `value`. (#7766)
  ...
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.

Locally-rejected invites don't get passed on to the client
2 participants