Skip to content

fix(teams): apply membership privacy to create and update responses - #15027

Merged
ChiragAgg5k merged 1 commit into
mainfrom
fix/membership-privacy
Oct 27, 2026
Merged

ChiragAgg5k merged 1 commit into
mainfrom
fix/membership-privacy

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Creating a membership or updating its roles returned the member's name and email even when the project hides them from other members. Both responses now follow the same privacy settings as the membership read endpoints, with the self, privileged and key exceptions.

Lint, PHPStan and the touched unit tests passed locally before rebasing on main; e2e runs in CI.

Related: appwrite-labs/cloud#6666

Creating a membership or updating its roles returned the member's name
and email even when the project hides them from other members. Both
responses now follow the same privacy settings as the membership read
endpoints, with the self, privileged and key exceptions.
@luxor-code-review

luxor-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review complete. No issues found — approved ✅.


This PR introduces membership privacy controls: projects can now hide member names and emails from team membership responses unless the caller is privileged, app-user, or viewing itself.

Files Change
src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php Applies the new privacy flags to the invitee's name/email in the create-membership response.
src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php Computes isVisible per membership and masks name/email for non-visible members.
tests/e2e/Services/Teams/TeamsBaseClient.php Adds console-vs-custom assertion branching and a shared privacy-toggle test flow.
tests/e2e/Services/Teams/TeamsCustomClientTest.php New testMembershipWritesFollowPrivacy exercising the hidden-PII behavior end to end.

Reviewed commit: 8988543

@ChiragAgg5k ChiragAgg5k self-assigned this Oct 27, 2026
@ghost

ghost commented Oct 27, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The response changes are consistent with the existing membership-read privacy rules, and the new E2E coverage exercises hidden and visible values.

Membership creation and role-update responses now apply project name and email privacy settings, while retaining visibility for the member, privileged users, and API keys. E2E coverage checks hidden and enabled privacy states and updates existing membership response expectations.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 4
File Change
src/Appwrite/Platform/Modules/Teams/Http/Memberships/Create.php Applies membership name and email privacy settings to created membership responses.
src/Appwrite/Platform/Modules/Teams/Http/Memberships/Update.php Applies membership name and email privacy settings to updated membership responses.
tests/e2e/Services/Teams/TeamsBaseClient.php Updates create-response expectations for projects that hide other members' names and emails.
tests/e2e/Services/Teams/TeamsCustomClientTest.php Covers hidden and enabled privacy behavior for create and update responses.

Reviewed 8988543 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Tier S · Looks good to merge. Summary

@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

6 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (3)
  • php.appwrite.secret-compare-timing (1)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → fix/membership-privacy (after).

Metric Before After Change
🚀 Requests/sec 200.53 218.78 🟢 +9.1%
⏱️ Latency P50 85.67 ms 79.42 ms 🟢 -7.3%
⏱️ Latency P95 199.15 ms 186.98 ms 🟢 -6.1%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 79.42 186.98 13,680 218.78 -12.18
Account 148.05 286.02 720 12.2 -5.97
TablesDB 77.23 144.37 7,440 121.74 -19.32
Storage 72.17 171.98 3,600 60.77 -12.46
Functions 113.31 216.67 1,920 33.11 -4.2

Top API waits (after)

API request Max wait (ms)
account.name.update 421.65
storage.buckets.create 380.96
account.prefs.update 373.22
tablesdb.rows.create 361.78
functions.create 346.54

@ChiragAgg5k
ChiragAgg5k merged commit 4c9bbc8 into main Oct 27, 2026
37 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/membership-privacy branch October 27, 2026 19:19
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.

1 participant