fix(packing): take a bringer off in one transaction, and settle the last baselines

Clearing a common item's owner and dropping the bringer row now happen inside
one unit of work, so a failure cannot leave one without the other. The lint
and RTL baselines follow the rows that lost their last physical sides.
This commit is contained in:
Maurice
2026-11-15 12:40:01 +01:00
parent a65342574a
commit 71510a62f3
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -35,7 +35,7 @@
},
"tests": {
"@typescript-eslint/no-explicit-any": 489,
"@typescript-eslint/no-non-null-assertion": 1877,
"@typescript-eslint/no-non-null-assertion": 1876,
"@typescript-eslint/no-misused-promises": 22,
"@typescript-eslint/no-unused-vars": 51,
"@typescript-eslint/no-floating-promises": 33,
-1
View File
@@ -39,7 +39,6 @@
"components/PDF/tripMapImage.ts": 1,
"components/Packing/PackingListPanelBagCard.tsx": 1,
"components/Packing/PackingListPanelCategoryGroup.tsx": 3,
"components/Packing/PackingListPanelItemRow.tsx": 2,
"components/Planner/DayDetailPanel.tsx": 1,
"components/Planner/PlaceInspector.tsx": 1,
"components/Planner/TransitSearchPanel.tsx": 3,
+4 -2
View File
@@ -422,8 +422,10 @@ export class PackingService {
if (!item) return null;
// On a Common item the owner is its first bringer, so taking them off the
// item has to clear the owner too; otherwise their avatar stuck for good (#3098).
if (item.is_private === 0 && item.owner_id === userId) await this.itemsRepo.clearOwner(id);
await this.contributorsRepo.deleteOne(id, userId);
await this.uow.transactional(async () => {
if (item.is_private === 0 && item.owner_id === userId) await this.itemsRepo.clearOwner(id);
await this.contributorsRepo.deleteOne(id, userId);
});
return (await this.enrichItems([await this.itemsRepo.findById(id)]))[0];
}