Skip to content

Commit

Permalink
feat: Remove special case for "me" update
Browse files Browse the repository at this point in the history
I had to start with a special case for "me" update, because in Cozy
Contacts, relations were stored only in the contact who created the
relation.

So when "me" was updated, a relation of me could have been deleted,
and it was impossible to know which one easily, so it was impossible
to know if the contact should be removed from the extension.

With cozy/cozy-contacts#1020, relations are
propagated to the target contact.

So we will get a realtime event and we will be able to check if the
contact must be displayed or not without any special case.
  • Loading branch information
zatteo committed Nov 15, 2024
1 parent 7705380 commit 3c915eb
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions apps/browser/src/cozy/realtime/RealtimeNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ export class RealTimeNotifications {
}

async dispatchUpdateContact(data: IOCozyContact) {
if (data.me) {
// We need to do a fullSync here because we have no other way to know
// if a contact related to me was removed of the me relation
this.logService.info(`Starting full sync from realtime because me`);

this.messagingService.send("fullSync");

return;
}

const contactMustBeDisplayed = await shouldDisplayContact(this.client, data);

if (contactMustBeDisplayed) {
Expand Down

0 comments on commit 3c915eb

Please sign in to comment.