-
Notifications
You must be signed in to change notification settings - Fork 5
ENG-1796 Duplicate entries in spaces_in_group function #1077
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| DROP VIEW public.my_pseudo_accounts; | ||
|
|
||
| CREATE VIEW public.my_pseudo_accounts AS | ||
| SELECT | ||
| pa.id, | ||
| pa.platform, | ||
| pa.dg_account, | ||
| gm.group_id, | ||
| gm.admin, | ||
| sa.space_id, | ||
| sp.name, | ||
| grpsa.permissions AS sharing_permissions | ||
| FROM public."PlatformAccount" AS pa | ||
| JOIN public.group_membership AS gm ON (member_id = pa.dg_account) | ||
| JOIN public.group_membership AS gm2 ON (gm2.member_id = auth.uid() AND gm2.group_id = gm.group_id) | ||
| JOIN public."SpaceAccess" AS sa ON (sa.account_uid = pa.dg_account) | ||
| JOIN public."Space" AS sp ON (sp.id = sa.space_id) | ||
| LEFT OUTER JOIN public."SpaceAccess" AS grpsa ON (grpsa.account_uid = gm.group_id AND grpsa.space_id = sp.id); | ||
|
|
||
| DROP FUNCTION public.spaces_in_group; | ||
|
|
||
| DROP TYPE public.group_space_info; | ||
|
Comment on lines
+20
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This migration drops Useful? React with 👍 / 👎. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The redefined
my_pseudo_accountsview no longer filters to anonymous editor accounts, so it now includes anyPlatformAccount/SpaceAccessrows for a group member. In groups where members also have non-anonymous accounts or non-editor access rows, this will inflate results and can reintroduce incorrect/duplicate member-space entries. Add back the predicate that limits rows to the intended pseudo-account shape.Useful? React with 👍 / 👎.