Page MenuHomePhabricator

[keyserver][lib] Add ACKNOWLEDGE relationship action
AcceptedPublic

Authored by inka on Tue, Jun 4, 7:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 18, 11:57 PM
Unknown Object (File)
Tue, Jun 18, 4:28 AM
Unknown Object (File)
Fri, Jun 14, 2:27 PM
Unknown Object (File)
Sun, Jun 9, 9:33 PM
Unknown Object (File)
Sun, Jun 9, 7:43 PM
Unknown Object (File)
Sun, Jun 9, 5:37 PM
Unknown Object (File)
Sat, Jun 8, 8:51 PM
Unknown Object (File)
Fri, Jun 7, 6:16 PM
Subscribers

Details

Reviewers
tomek
kamil
Summary

issue: ENG-7822
We need to fetch avatars for users the client has become aware of. We want the keyserver to remember that the users now know of each other and send an update to the second user.
So we will use the updates to obtain the avatar - we will call an endpoint that will update the relationshipt to "KNOW_OF", if there is no other undirected relationship. This endpoint will create updates if needed

Test Plan

Dispatched updateRelationship with relationshipActions.ACKNOWLEDGE and checked that both users get and update, and if the user has an avatar set, this avatar is sent in the update. Checked in the keyserver db that the users now have a KNOW_OF relationship

Diff Detail

Repository
rCOMM Comm
Branch
inka/userStore
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

keyserver/src/updaters/relationship-updaters.js
257

updateChangedUndirectedRelationships only updates the relationship if there was none, or the relationship status provided it greater than the one in the db. This will not be the case here, because KNOW_OF is 0-the lowest possible value. So we will not override a more meaningful relationship.

inka requested review of this revision.Tue, Jun 4, 8:12 AM
tomek added inline comments.
keyserver/src/updaters/relationship-updaters.js
257

Makes sense, but is there an easy way of checking if the relationship doesn't need to be updated?

This revision is now accepted and ready to land.Wed, Jun 5, 2:26 AM
keyserver/src/updaters/relationship-updaters.js
257

The only thing this function does is checking if the relationship needs to be updated, and if so updates it. So I don't think it makes sense to duplicate this logic.
We discussed this offline and agreed that this code makes sense and can be left as is.