Skip to content

Ensure clients only receive messages meant for them in remote convs#1739

Merged
akshaymankar merged 7 commits intodevelopfrom
akshaymankar/fed-message-pointed-notifications
Sep 8, 2021
Merged

Ensure clients only receive messages meant for them in remote convs#1739
akshaymankar merged 7 commits intodevelopfrom
akshaymankar/fed-message-pointed-notifications

Conversation

@akshaymankar
Copy link
Member

@akshaymankar akshaymankar commented Sep 7, 2021

This PR removes duplicated logic to push messages to clients by making logic
in Galley.API.Message.sendLocalMessages accomodating to pushing messages for
remote conversations, but still enforcing the recipients to be local. Using this
function from federation endpoint of galley allows us to not duplicate the logic
for how a message becomes an event and gets pushed to each client.

The PR also moves this logic from Galley.API.Update to Galley.API.Federation
as most of the logic to translate from inputs of the federation endpoint to
inputs for Galley.API.Message.sendLocalMessages is very federation specific and
doesn't need to live in the public API module.

Checklist

  • The PR Title explains the impact of the change.
  • The PR description provides context as to why the change should occur and what the code contributes to that effect. This could also be a link to a JIRA ticket or a Github issue, if there is one.
  • If end-points have been added or changed: the endpoint / config-flag checklist (see Wire-employee only backend wiki page) has been followed.
  • If a schema migration has been added, I ran make git-add-cassandra-schema to update the cassandra schema documentation.
  • Section Unreleased of CHANGELOG-draft.md contains the following bits of information:
    • A line with the title and number of the PR in one or more suitable sub-sections.
    • If /a: measures to be taken by instance operators.
    • If /a: list of cassandra migrations.
    • If public end-points have been changed or added: does nginz need upgrade?
    • If internal end-points have been added or changed: which services have to be deployed in a specific order?

@akshaymankar akshaymankar changed the title Ensure clients only recieve messages meant for them in remote convs Ensure clients only receive messages meant for them in remote convs Sep 7, 2021
This commit removes duplicated logic to push messages to clients by making logic
in Galley.API.Message.sendLocalMessages accomodating to pushing messages for
remote conversations, but still enforcing the recipients to be local. Using this
function from federation endpoint of galley allows us to not duplicate the logic
for how a message becomes an event and gets pushed to each client.

The commit also moves this logic from Galley.API.Update to Galley.API.Federation
as most of the logic to translate from inputs of the federation endpoint to
inputs for Galley.API.Message.sendLocalMessages is very federation specific and
doesn't need to live in the public API module.
@akshaymankar akshaymankar force-pushed the akshaymankar/fed-message-pointed-notifications branch from d0d800c to 591cd33 Compare September 8, 2021 06:47
Copy link
Contributor

@pcapriotti pcapriotti left a comment

Choose a reason for hiding this comment

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

There were some FUTUREWORK merge mishaps, for which I added suggestions. Looks good otherwise.

akshaymankar and others added 2 commits September 8, 2021 13:25
@akshaymankar akshaymankar merged commit a0ea30c into develop Sep 8, 2021
@akshaymankar akshaymankar deleted the akshaymankar/fed-message-pointed-notifications branch September 8, 2021 14:17
akshaymankar added a commit that referenced this pull request Sep 9, 2021
@jschaul jschaul mentioned this pull request Sep 13, 2021
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

Successfully merging this pull request may close these issues.

2 participants