Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/fix-dev-env-scope-wrong-member.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Fix `OrganizationsPresenter.#getEnvironment` matching the wrong development environment on teams with multiple members. All dev environments share the slug `"dev"`, so the previous `find` by slug alone could return another member's environment. Now filters DEVELOPMENT environments by `orgMember.userId` to ensure the logged-in user's dev environment is selected.
6 changes: 5 additions & 1 deletion apps/webapp/app/presenters/OrganizationsPresenter.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,11 @@ export class OrganizationsPresenter {
})[];
}) {
if (environmentSlug) {
const env = environments.find((e) => e.slug === environmentSlug);
const env = environments.find(
(e) =>
e.slug === environmentSlug &&
(e.type !== "DEVELOPMENT" || e.orgMember?.userId === user.id)
);
if (env) {
return env;
}
Expand Down
Loading