[PR #2002] [MERGED] Fix failure to create category with deleted name #4065

Closed
opened 2026-02-28 20:51:01 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/2002
Author: @kymckay
Created: 12/1/2023
Status: Merged
Merged: 12/5/2023
Merged by: @youngcw

Base: masterHead: 1963


📝 Commits (3)

  • 37da881 Fix failure to create category with deleted name
  • ce4898b Add release note
  • ef65b49 Add regression test

📊 Changes

3 files changed (+22 additions, -1 deletions)

View changed files

📝 packages/loot-core/src/server/db/index.test.ts (+15 -0)
📝 packages/loot-core/src/server/db/index.ts (+1 -1)
upcoming-release-notes/2002.md (+6 -0)

📄 Description

I'm not 100% familiar with the design of the data model so may have misinterpreted what's going on here, but how I read this:

  • The tombstone flag is used to soft delete categories.
  • When creating a new category, duplicate names within a group are prevented.
  • When checking for duplicate names, the tombstone flag was unchecked which meant deleted categories were falsely blocking creation.

I had a look at category deleteion logic to verify that simply including the tombstone flag in this check is sane and see that there's a category mapping being maintained to redirect one category to another on deletion. So from what I can tell the correct behaviour here is to allow a new category with the previously deleted name, rather than to revive the old category (to preserve that old mapping lineage).

Fixes #1963


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/2002 **Author:** [@kymckay](https://github.com/kymckay) **Created:** 12/1/2023 **Status:** ✅ Merged **Merged:** 12/5/2023 **Merged by:** [@youngcw](https://github.com/youngcw) **Base:** `master` ← **Head:** `1963` --- ### 📝 Commits (3) - [`37da881`](https://github.com/actualbudget/actual/commit/37da8819450cabe73ca6a8eb2a2ff0c8e45141a7) Fix failure to create category with deleted name - [`ce4898b`](https://github.com/actualbudget/actual/commit/ce4898bbeba18a9e1f3bb1d138c70404cc549230) Add release note - [`ef65b49`](https://github.com/actualbudget/actual/commit/ef65b49e5311ed994787610063385147c7eccf3a) Add regression test ### 📊 Changes **3 files changed** (+22 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/db/index.test.ts` (+15 -0) 📝 `packages/loot-core/src/server/db/index.ts` (+1 -1) ➕ `upcoming-release-notes/2002.md` (+6 -0) </details> ### 📄 Description I'm not 100% familiar with the design of the data model so may have misinterpreted what's going on here, but how I read this: - The tombstone flag is used to soft delete categories. - When creating a new category, duplicate names within a group are prevented. - When checking for duplicate names, the tombstone flag was unchecked which meant deleted categories were falsely blocking creation. I had a look at category deleteion logic to verify that simply including the tombstone flag in this check is sane and see that there's a category mapping being maintained to redirect one category to another on deletion. So from what I can tell the correct behaviour here is to allow a new category with the previously deleted name, rather than to revive the old category (to preserve that old mapping lineage). Fixes #1963 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 20:51:01 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#4065