Link previews and shared URLs doesn't contain data for self contact link #4154
Labels
E:Bug MVP
E:Desktop New Share URL Format
Implementation of the new share URL link format and other deep link associated issues
E:New Unfurling API
Implementation of the new unfurling API for all links
Problem
When calling a
ShareUserURLWithData
orStatusUnfurler.buildContactData
with self public key, the result won't contain any data likeDisplayName
,Description
,thumbnail
.Implementation
In both cases:
status-go/protocol/messenger_share_urls.go
Line 500 in 157e2de
status-go/protocol/linkpreview_unfurler_status.go
Line 54 in 157e2de
... the contact is requested with
messenger.allContacts.Load
, which has custom handling for self-requests:status-go/protocol/messenger_maps.go
Lines 63 to 73 in 244b427
The problem is that
contactMap.me
is created with no properties and is never updated.I think there might be more affected places.
Notes
The thing is that yourself is not a contact. The original change (#3627) for
ContactsMap
still makes sense. We should avoid storing ourselves as a contact.There're 2 ways out of this:
ContactsMap
as is and updatemessenger.GetContactByID
so that it checks if self-request if made, build and return a valid contact from there.ContactsMap
up-to-date. This will require updating it on each change likeSetDisplayName
,SetBio
, etc.I tend to go with option
1
.The text was updated successfully, but these errors were encountered: