Skip to content

fix(album): roll back failed database transactions - #3760

Merged
susnux merged 2 commits into
masterfrom
jtr/fix-album-transaction-rollbacks
Aug 22, 2026
Merged

susnux merged 2 commits into
masterfrom
jtr/fix-album-transaction-rollbacks

Conversation

@joshtrichards

Copy link
Copy Markdown
Member

Ensure album database transactions are rolled back when an exception occurs during multi-step operations.

Prevents partial collaborator updates or album deletions when a later database operation fails.

  • Roll back the transaction and rethrow the original exception when setCollaborators() fails.
  • Apply the same transaction-safety pattern to delete().
  • Catch \Throwable so both exceptions and PHP errors cannot leave a transaction open.
  • Preserve the existing commit behavior when all operations complete successfully.

Since this was a tiny fix didn't think bother to use the TTransactional helper.

馃 AI (if applicable)

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

@joshtrichards joshtrichards added bug Something isn't working 3. to review Waiting for reviews labels Aug 16, 2026
@joshtrichards
joshtrichards requested a review from artonge August 16, 2026 22:51
@susnux

susnux commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Linting needs to be fixed

@susnux
susnux force-pushed the jtr/fix-album-transaction-rollbacks branch from c558a2f to e2ef90b Compare August 19, 2026 17:00
Signed-off-by: Josh <josh.t.richards@gmail.com>
Signed-off-by: Josh <josh.t.richards@gmail.com>
@susnux
susnux force-pushed the jtr/fix-album-transaction-rollbacks branch from e2ef90b to cdf95e4 Compare August 22, 2026 10:06
@susnux
susnux merged commit 7472fd2 into master Aug 22, 2026
53 of 54 checks passed
@susnux
susnux deleted the jtr/fix-album-transaction-rollbacks branch August 22, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants