Skip to content

fix(files): roll back activity transaction when activity publishing f…#2812

Open
karlitschek wants to merge 1 commit into
masterfrom
fix/rollback-activity-transaction-on-failure
Open

fix(files): roll back activity transaction when activity publishing f…#2812
karlitschek wants to merge 1 commit into
masterfrom
fix/rollback-activity-transaction-on-failure

Conversation

@karlitschek

@karlitschek karlitschek commented Jul 22, 2026

Copy link
Copy Markdown
Member

…ails

The activity fan-out loops wrapped in startActivityTransaction() / commitActivityTransaction() had no error path: any exception while publishing activities left an open transaction on the shared database connection for the rest of the request and never reset the deferred state of the notification manager, silently swallowing all subsequent notifications and putting later writers inside a doomed transaction.

Wrap the loops in try/catch, roll the transaction back on failure and flush the notification manager to reset its deferred state before rethrowing.

🤖 AI (if applicable)

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

…ails

The activity fan-out loops wrapped in startActivityTransaction() /
commitActivityTransaction() had no error path: any exception while
publishing activities left an open transaction on the shared database
connection for the rest of the request and never reset the deferred
state of the notification manager, silently swallowing all subsequent
notifications and putting later writers inside a doomed transaction.

Wrap the loops in try/catch, roll the transaction back on failure and
flush the notification manager to reset its deferred state before
rethrowing.

Signed-off-by: Frank Karlitschek <karlitschek@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@karlitschek

Copy link
Copy Markdown
Member Author

@nickvergessen

@nickvergessen nickvergessen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

https://github.com/nextcloud/activity/pull/2812/changes?w=1 looks good, but I'm not the maintainer

@Antreesy
Antreesy requested a review from miaulalala July 23, 2026 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants