Skip to content

Add Team activity stream - #3024

Draft
hefftich wants to merge 2 commits into
masterfrom
feature/team-activity
Draft

hefftich wants to merge 2 commits into
masterfrom
feature/team-activity

Conversation

@hefftich

@hefftich hefftich commented Oct 9, 2026 •

Copy link
Copy Markdown

Resolves: nextcloud/circles#2692

Needs Server/OCP-Change: nextcloud/server#65347

Adds a Team Activity stream that combines Team roster events with activity from resources shared with the Team.

The stream verifies membership, resolves only resources the viewer can currently access, deduplicates recipient-specific file events, and preserves stable pagination, filters, search, and ETag behavior.

It adds resource-provider support through ITeamActivityResourceProvider, covers the resolver, stream pagination, response behavior, and documents the new API endpoint.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (GitHubCopilot:GPT-5.6-Terra / GPT-6.1-Sol)

@hefftich hefftich self-assigned this Oct 9, 2026
@hefftich
hefftich force-pushed the feature/team-activity branch from 5b7d9b7 to 240a3ac Compare October 9, 2026 22:05
@hefftich hefftich moved this from Backlog to In review in 👥 Teams Oct 12, 2026
@hefftich hefftich moved this from In review to In progress in 👥 Teams Oct 12, 2026
@hefftich hefftich moved this from In review to In progress in 👥 Teams Oct 13, 2026
@hefftich
hefftich requested a review from artonge October 14, 2026 08:14
Comment thread lib/Data.php Outdated
$this->applyStreamConditions($query, $userSettings, $user, 'all', $activeFilter, '', 0, null, false);
$this->applyTeamSearchCriteria($query, $search ?? SearchCriteria::empty(), $objectType === 'circles');
$query->andWhere($query->expr()->eq('object_type', $query->createNamedParameter($objectType)));
$query->andWhere($query->expr()->in('object_id', $query->createNamedParameter($objectIds, IQueryBuilder::PARAM_INT_ARRAY)));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

If I understand correctly, you filter the activity list based on the ids received form the ressource providers.

But the ressource providers for groupfolders only returns the top level file id, and not all the file ids contains within the groupfolders. So we will miss any activity on a file within the groupfolders.

As groupfolders can contains large number of files, $resourceScope->getObjectIds() should return an iterator and not an array. But even with that, I don't think this will scale, as the SQL query could be huge if it contains all the file ids.

One solution would be to join the filecache table, and to select files that are stored on the storage id of the groupfolder. This would be really custom to files though, but I don't think there is a better way to do it.

We faced a similar issue when bulding the "focus" view for the user's own files, and we are still trying to improve its perfomance as it is currently really slow. cc @come-nc

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I've switched this to a filecache join, similar to focused, so providers only need to return root IDs—no recursive traversal or huge ID lists.

We filter by storage and subtree, then check candidates against the viewer's mounts and ACLs. Pagination keeps fetching past inaccessible entries.

Is it a better way?

@hefftich
hefftich force-pushed the feature/team-activity branch 3 times, most recently from 2b938de to a332a2e Compare October 19, 2026 13:24
hefftich and others added 2 commits October 19, 2026 15:27
Assisted-by: GitHubCopilot:GPT-5.6-Terra
Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Stefan Lender <Stefan.Lender@dataport.de>
@hefftich
hefftich force-pushed the feature/team-activity branch from a332a2e to 6085032 Compare October 19, 2026 13:27
@hefftich
hefftich requested a review from artonge October 19, 2026 13:36
@hefftich hefftich moved this from In progress to In review in 👥 Teams Oct 19, 2026
@hefftich hefftich added this to the Nextcloud 36 milestone Oct 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Show activity of team in Teams app

2 participants