Skip to content

Comments

%contacts: repurpose the directory scry#314

Open
mikolajpp wants to merge 4 commits intodevelopfrom
mp/contacts
Open

%contacts: repurpose the directory scry#314
mikolajpp wants to merge 4 commits intodevelopfrom
mp/contacts

Conversation

@mikolajpp
Copy link
Collaborator

@mikolajpp mikolajpp commented Apr 1, 2025

Previously the %contacts agent exposed the /v1/all scry that
returned the collection of all merged contacts, including peers.
This endpoint was never used. A need now arises for a scry endpoint that would rather serve unmerged contacts.

We remove the never used /v1/all endpoint, change the definition of $directory, and serve the unmerged contact directory at /v1/directory.

Closes TLON-3879

@mikolajpp mikolajpp requested review from Fang- and arthyn April 1, 2025 16:40
@mikolajpp mikolajpp changed the title Contacts: repurpose the directory scry %contacts: repurpose the directory scry Apr 1, 2025
@linear
Copy link

linear bot commented Apr 1, 2025

Previously the %contacts agent exposed the /v1/all scry that
returned the collection of all merged contacts, including peers.
This endpoint was never used, and a need now arises for a scry endpoint that would rather serve unmerged information.

We remove the never used /v1/all endpoint, change the definition of $directory, and serve the unmerged contact directory at /v1/directory.
Copy link
Member

@arthyn arthyn left a comment

Choose a reason for hiding this comment

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

This seems good, we just need a little more data on the client I think

:: $directory: all known contacts
::
+$ directory (map ship contact)
+$ directory (map ship page)
Copy link
Member

Choose a reason for hiding this comment

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

not sure about the name but I think we'll need something like this, because when the client parses the API response it won't know the difference between a peer or a contact that has no modifications.

Suggested change
+$ directory (map ship page)
+$ directory (map ship marked-page)
+$ marked-page [contact=? page]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think the client already uses the /v1/book scry to grab contact list, and /v1/directory is not meant as a replacement? Querying the book to tell that difference would be easy, but perhaps there is some context I miss here.

Copy link
Member

@latter-bolden latter-bolden Apr 3, 2025

Choose a reason for hiding this comment

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

We do use /v1/book right now to grab contacts. You're correct that that we could use that list to take these /v1/directory results and subtract the people from /v1/book to get the correct "complete set". We could do something similar with the existing /v1/all scry, so this wouldn't really unlock any benefit.

My understanding was the intention of /v1/directory was to serve as a single scry we could use to get all data we need — contacts and non-contacts (would replace /v1/book).

The issue with the current implementation is there's no way to distinguish between non-contact peers and contacts who have no overrides set. Both will serialize identically. That difference is meaningful and needs to be reflected somehow in the data.

@arthyn
Copy link
Member

arthyn commented Apr 2, 2025

Talking with @latter-bolden it seems like there's not a rush for this, we should maybe just PR against tloncorp/tlon-apps

@mikolajpp
Copy link
Collaborator Author

If we can wait that's great. I will redirect this PR to tlon-apps then.

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.

3 participants