mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
[PR #14746] [MERGED] Attach before updating/deleting to avoid DbUpdateConcurrencyException #14094
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/jellyfin/jellyfin/pull/14746
Author: @evan314159
Created: 9/5/2025
Status: ✅ Merged
Merged: 9/20/2025
Merged by: @crobibero
Base:
master← Head:fix-users-update-delete📝 Commits (3)
746c1daRefresh user record before updating/deleting to avoid DbUpdateConcurrencyException816a12euse ExecuteDeleteAsync instead of FindAsync & Removef6197e5register user in change tracker instead of finding in database first📊 Changes
1 file changed (+3 additions, -1 deletions)
View changed files
📝
Jellyfin.Server.Implementations/Users/UserManager.cs(+3 -1)📄 Description
Changes
Attach user before updating/deleting to avoid DbUpdateConcurrencyException
Issue
[16:35:17] [ERR] [91] Jellyfin.Api.Middleware.ExceptionMiddleware: Error processing request. URL DELETE /Users/3f18f29e944c43f0b75981be1190b046. Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data may have been modified or deleted since entities were loaded. See https://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.