Repository navigation
Conversation
GET /api/v1/users/{handle} sends bio_profiles, the tagged handles that
have a page here, but not what each one is. It now also sends
bio_profile_types, mapping each of those lowercase handles to user,
organization or unclaimed, decided the way /@{handle} decides. It is one
query for all the tags, using withExists on the profile's user.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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.
Summary
GET /api/v1/users/{handle}sendsbio_profiles, the handles tagged in a user's bio or company that have a page here. It doesn't say whether each one is a user or an organization. The mobile app (NativePHP/dev-null-app#181) draws bio tags like the web'sBioTextand opens the app's own screen for them, so today it opens every tag as a user, waits for the 404, and then switches to the organization screen. Unclaimed developers end up on the organization screen and fail, because the app has no unclaimed-profile screen.The response now also has
bio_profile_types, which the app already reads when it's there:Changes
BioProfilesQuery::types()returns the same lowercase handles asget(), each mapped the way/@{handle}decides inroutes/web.php:userwhen a user has the handle,organizationfor an organization's profile, andunclaimedfor a user profile with no user. It is one query for all the tags,withExists('user')on the profiles, and no query when the bio and company tag no one. The API controller sends it next tobio_profiles, as an object likebio_profilesso an empty one is{}, for signed and unsigned requests. One sentence inKNOWLEDGE_BASE.mdunder the public read API.The response now runs two profile queries instead of one, since
get()andtypes()each query. I keptget()as it is because the web uses it. They could share one query if you'd rather.Validation
Local, PHP 8.5.12, PostgreSQL with its own test database:
tests/Unit/Queries/BioProfilesQueryTest.php,tests/Feature/Controllers/Api/UserControllerTest.php,tests/Feature/Controllers/UserControllerTest.phpandtests/Feature/Controllers/UserPreviewControllerTest.php: 103 passed. New tests cover a user, an organization, an unclaimed developer, a handle not on the site and one in a code span, in one query, and the field on signed and unsigned requests.pint --teston the changed files: passrector --dry-runon the changed files: passphpstan: pass, no errorspest --type-coverage --min=100: 100%Visual evidence
None. This is an API field with no web UI change.
Independent review
A read-only Claude review agent with the repo's
.ai/guidelinesand the diff againstproductionat 2ef29e7, head 9356ade: CODE: PASS. Its two wording notes (the knowledge base sentence and the controller docblock mentioning the company) are fixed in ded1e3e, which changes only those two lines.Limitations
None.