Repository navigation
fix(teams): accept null optional membership fields - #13541
Merged
Merged
Conversation
Contributor
Greptile SummaryThis PR updates team membership creation to accept explicit null values for optional string fields and normalize them to the existing empty-string defaults.
Confidence Score: 5/5The PR appears safe to merge with no outstanding correctness or repository-rule issues. The previous cleanup finding is fully addressed by saving the created user ID immediately after confirming membership creation, before subsequent assertions can fail; no new issues were introduced by that change. Important Files Changed
Reviews (2): Last reviewed commit: "test(teams): capture created user before..." | Re-trigger Greptile |
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
loks0n
approved these changes
Sep 8, 2026
2 of 4 tasks
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.
What does this PR do?
Fixes team membership creation returning HTTP 500 when an optional string is explicitly
nullin a JSON request. Utopia HTTP accepts null for optional parameters, but the action required non-null strings.Accept nullable
email,userId,phone,url, andname, then normalize them to their existing empty-string defaults. Identity requirements, URL requirements for client invitations, and non-null input validation remain unchanged. This belongs in CE because Cloud uses this handler fromappwrite/server-ce.Test Plan
Tested through the real local CE HTTP API with PostgreSQL and Redis, using PHP 8.5.10 / PHPUnit 12.5.34. No mocks of the handler or database and no unit tests added.
Commands run inside the local API container:
Full-suite limitation: the unfiltered
TeamsCustomServerTest.phprun passed 12 of 13 tests.testDeleteUserUpdatesTeamMembershipCounttimed out waiting for the async deletes worker to reduce the team count from 1 to 0. Re-ran that test with the original handler restored and reproduced the same failure. It is not counted as passing. Client invitation/email delivery flows were not run. This is a backend-only change; screenshots are not applicable.Related PRs and Issues
Checklist