feat: add event handling to auto create teamfolders upon circle creation - #4941
feat: add event handling to auto create teamfolders upon circle creation#4941stediefan wants to merge 3 commits into
Conversation
… upon circle creation feat: add team_circle_id flag to teamfolder to uniquely link a team feat: adminUI: add filters for classic teamfolders and the newly linked ones todo: sensible naming for the two types of folders Assisted by: GitHub Copilot:Claude Sonnet 5 Assisted by: GitHub Copilot:GPT-5.6 Terra Assisted by: GitHub Copilot:Kimi K2.7 Code Signed-off-by: Stefan Dietrich <5716289+stediefan@users.noreply.github.com>
c296a5d to
89077f1
Compare
| } | ||
|
|
||
| if (!$table->hasIndex('group_folders_team_circle')) { | ||
| $table->addUniqueIndex(['team_circle_id'], 'group_folders_team_circle'); |
There was a problem hiding this comment.
as far as I can see, this wasn't enforced previously with the options.circle_id, so this might cause some issues
There was a problem hiding this comment.
There was some additional code I overlooked. Should be more concise now:
This index belongs to a new property that links the folder 1:1 to a team. As the property is newly created we shouldn't have any issues here.
89077f1 to
6243fc7
Compare
Co-authored-by: Copilot <copilot@github.com> Signed-off-by: Stefan Dietrich <5716289+stediefan@users.noreply.github.com>
6243fc7 to
8bc6323
Compare
Signed-off-by: Stefan Dietrich <5716289+stediefan@users.noreply.github.com>
| /** | ||
| * Introduces the `team_circle_id` column on `group_folders` so that the | ||
| * "this folder belongs to a team" relationship is stored as an explicit, | ||
| * indexed, queryable column. |
There was a problem hiding this comment.
That could not be done with the goup_folders_groups table?
Is goup_folders_groups still populated with the circle ID?
I fear that not populating goup_folders_groups could lead to subtle bugs as the code base currently assume that it is the source of truth.
I would rather add a column in the group_folders table to denote that a groupfolders assignment is limited to one group/circles only.
What do you think?
There was a problem hiding this comment.
Group_folders_groups is still populated via createTeamSpace() calling addApplicableGroup() (lib/TeamSpace/TeamSpaceService.php:58), so existing access and membership paths like getFoldersFromCircleMemberships() should continue to work without changes.
Team_circle_id is not a replacement for group_folders_groups. It indicates the ownership of the groupfolder in contrast to the Multi mounting prior (which is still possible with the non team-owned folders). Combining these in group_folders_groups.circle_id causes issues when admins assign multiple circles or re-add an owning circle. The unique index on team_circle_id also enforces "one team space per team" at the database level.
A boolean is_team_space column would still require a separate lookup to find the owning circle, whereas team_circle_id serves as both the flag and the reference in a single indexed read.
Both stores are synchronized: unlinkTeamSpace() clears team_circle_id and removes the group_folders_groups row (lib/TeamSpace/TeamSpaceService.php:122-123), maintaining group_folders_groups for all previous use cases and team_circle_id for the ownership.
feat: add team_circle_id flag to teamfolder to uniquely link a team
feat: adminUI: add filters for classic teamfolders and the newly linked ones
todo: sensible naming for the two types of folders
Assisted by: GitHub Copilot:Claude Sonnet 5
Assisted by: GitHub Copilot:GPT-5.6 Terra
Assisted by: GitHub Copilot:Kimi K2.7 Code
Related Issues in Circles:
nextcloud/circles#2661
nextcloud/circles#2663
nextcloud/circles#2669
Related Pull Request in server: nextcloud/server#62476
Related Pull Request in circles: nextcloud/circles#2675
🤖 AI (if applicable)