Skip to content

feat(core): import scope that keeps imports quiet - #66175

Open
karlitschek wants to merge 2 commits into
masterfrom
feat/import-scope
Open

karlitschek wants to merge 2 commits into
masterfrom
feat/import-scope

Conversation

@karlitschek

@karlitschek karlitschek commented Nov 3, 2026 •

Copy link
Copy Markdown
Member
  • Resolves: #

Summary

Migrations from other systems and restores from backups write content that users already know, often millions of files, shares and calendar entries at once. Today every one of those writes produces an activity entry, a notification or a share mail, so users get flooded with news about their own old data.

This adds the public API OCP\Import\IImportScope. Code that runs inside IImportScope::run() counts as an import, and while it is active:

  • the activity manager drops publish() / bulkPublish() events,
  • the notification manager drops notifications,
  • the share manager sends no share mails,
  • contactsinteraction does not record the import's shares as "recently contacted".

Everything else (events, hooks, file cache, versions, …) works as usual. Calls can be nested; the import ends when the outermost callback returns or throws. Apps that inform users through their own channels can check IImportScope::isActive().

Tests cover the scope itself and each of the consumers (Activity, Notification and Share20 manager tests, contactsinteraction listener).

This draft description was written with AI assistance (Claude Code) at the author's request; the author reviews it before the PR leaves draft.

TODO

  • Author's description and sign-off

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

This change was written with Claude Code (claude-opus-5-5) and is to be reviewed by the author before it leaves draft; every commit carries an Assisted-by trailer. Commits still need the author's sign-off (DCO).

🤖 Generated with Claude Code

@karlitschek

Copy link
Copy Markdown
Member Author

This is needed for an upcoming migration app.

@karlitschek
karlitschek marked this pull request as ready for review November 3, 2026 12:00
@karlitschek
karlitschek requested review from Altahrim, leftybournes, pabzm, provokateurin and sorbaugh and removed request for a team November 3, 2026 12:00
@susnux
susnux requested review from a team, come-nc and marcoambrosini and removed request for a team, pabzm and sorbaugh November 3, 2026 12:12
@karlitschek
karlitschek force-pushed the feat/import-scope branch 3 times, most recently from 27fbfa5 to 0f248cb Compare November 3, 2026 19:45
karlitschek and others added 2 commits November 3, 2026 23:20
Migrations and restores write content that users already know, often
millions of files and shares at once. Code that runs inside
IImportScope::run() is an import: activity events and notifications are
dropped and share mails are not sent, so users aren't flooded. Apps that
inform users through other channels (activity's file hooks, push) can
check IImportScope::isActive().

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
An import that creates shares, or calendar shares, for its users made
every recipient a "recently contacted" person of the share owner,
because the share and calendar listeners report each new share as a
contact interaction. Inside IImportScope the listener skips recording
them; the people didn't contact each other, the import did.

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>

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

None yet

Development

Successfully merging this pull request may close these issues.

2 participants