Repository navigation
Conversation
This was referenced Oct 22, 2026
Taldres
force-pushed
the
feat/who-to-follow-api
branch
from
October 22, 2026 20:26
f06d54c to
6dd6f0c
Compare
Taldres
added a commit
to Taldres/dev-null-app
that referenced
this pull request
Oct 23, 2026
Three people you might want to follow sit under the fifth commit, each
with why they're suggested, Follow and Not interested. Devnull sends
three spares, so one dismissed gives their place to the next, and the
round is asked again to top the spares up. The refresh moves to the next
page of the day's picks. Don't show again hides it with an Undo, and a
switch in settings brings it back.
Needs GET /api/v1/me/suggested-users and POST /api/v1/users/{username}/dismiss
from dev-null-sh/dev-null.sh#990.
Taldres
force-pushed
the
feat/who-to-follow-api
branch
from
October 23, 2026 12:32
6dd6f0c to
7b64f62
Compare
Contributor
|
@xHeaven @nunomaduro can we get this into the API so we can show "Who to follow?" |
Member
The "Who to follow" algo changed a bit in #1021, can you guys check if this PR needs to be adjusted? |
Contributor
Author
|
Yep. I'll check it later |
The mobile app can show who to follow as the web does: the same three people and three spares, a new page of the day's picks each round, with why each one is suggested and whether they follow you. Not interested keeps someone out of the suggestions for good, as on the web.
Taldres
force-pushed
the
feat/who-to-follow-api
branch
from
October 24, 2026 05:24
7b64f62 to
43fee92
Compare
Taldres
added a commit
to Taldres/dev-null-app
that referenced
this pull request
Oct 24, 2026
Three people you might want to follow sit under the fifth commit, each
with why they're suggested, Follow and Not interested. Devnull sends
three spares, so one dismissed gives their place to the next, and the
round is asked again to top the spares up. The refresh moves to the next
page of the day's picks. Don't show again hides it with an Undo, and a
switch in settings brings it back.
Needs GET /api/v1/me/suggested-users and POST /api/v1/users/{username}/dismiss
from dev-null-sh/dev-null.sh#990.
Takes the context the web passes since dev-null-sh#1021: `username` for a profile, `commit_id` for a commit the user can see, as its page requires. Without either, the suggestions stay as they were.
Contributor
Author
@xHeaven Thanks for the hint! I updated the branch for #1021.
Without these parameters, nothing changes. A test checks that the API returns the same suggestions as the web for the same page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets the mobile app show who to follow as the web does. It follows #130 and is for the app's roadmap item, NativePHP/dev-null-app#72.
The web gets its suggestions as the
suggestedUsersInertia prop and dismisses them throughPOST /@{user}/dismiss, neither of which a signed request can reach. Both endpoints reuse what the web runs:SuggestedUsersQueryandCreateSuggestionDismissal.Endpoints
GET /api/v1/me/suggested-usersanswers with the people the web would suggest, asUserResources: three to show and three spares to fill the place of one dismissed, as the web asks for them. Each one hasfollowers_count,followed_by_following_count(new onUserResource, only set here) andfollows_youfor the reason line and the follow-back, andis_followed: false, as other lists of people say it.?round=Nis the next page of the day's picks, as the web's refresh button moves through them with itswho_to_follow_roundcookie. A missing or empty round is the first.?username=or?commit_id=asks for the suggestions as the web shows them beside that profile or commit since #1021: the people the profile follows, or the thread's other participants, come first, and the regular suggestions fill the rest. The commit has to be one the user can see, as its page requires, otherwise the answer is422with "That commit is no longer available." An unknown username is422too, and so is passing both. Across a block, a profile is ignored and the suggestions are the regular ones, as on the web. Without either, nothing changes.{"data": [{"id": "…", "username": "octocat", "name": "The Octocat", "lane": 3, "followers_count": 12, "followed_by_following_count": 2, "follows_you": false, "is_followed": false, "…": "…"}]}POST /api/v1/users/{username}/dismissmarks someone Not interested and answers204. As on the web, they are never suggested again, nothing else changes, and dismissing yourself is403.Muted people, anyone across a block, and dismissed people are left out, as the query already does for the web.
Testing
Pint, Rector, PHPStan, type coverage at 100%, and all 4,149 tests pass locally (without the coverage driver, so line coverage is CI's to confirm). The new tests cover both halves of the mix, rounds, dismissals, mutes and blocks, the profile and commit context, commits the user can't see, validation, and unsigned requests, and that the endpoint answers what the web does for the same profile or commit page.
The app side is NativePHP/dev-null-app#74. It ran against this branch on an iOS simulator: following, dismissing with the spares moving up, and the next round. The app only shows who to follow in the Log, as the web does on smaller screens, so it doesn't pass a context.