[PR #2970] [MERGED] Fix false positives for duplicate filters error when saving a new filter #4615

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/2970
Author: @scivarolo
Created: 7/3/2024
Status: Merged
Merged: 8/3/2024
Merged by: @twk3

Base: masterHead: filter-compare-logic


📝 Commits (8)

  • 7da5d00 update conditionExists function to compare filter options
  • 8d230ee rename method
  • 1387e06 array.some instead of for loop
  • ca04f60 release note
  • b99a54a Merge branch 'master' into filter-compare-logic
  • ef166c7 Merge branch 'master' into filter-compare-logic
  • e810441 refactor the condition search
  • 715666a Merge branch 'master' into filter-compare-logic

📊 Changes

2 files changed (+41 additions, -27 deletions)

View changed files

📝 packages/loot-core/src/server/filters/app.ts (+35 -27)
upcoming-release-notes/2970.md (+6 -0)

📄 Description

Fixes #2937

Adds additional logic to the conditionExists function to also compare theoptions object. Fields like Amount, Amount (inflow), Amount (outflow) were matching as the same condition because their only difference lies within the options object:

image

I also refactored the logic to remove Array.map() in favor of Array.some() so that the loops can short circuit as soon as the condition is met.


🔄 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/2970 **Author:** [@scivarolo](https://github.com/scivarolo) **Created:** 7/3/2024 **Status:** ✅ Merged **Merged:** 8/3/2024 **Merged by:** [@twk3](https://github.com/twk3) **Base:** `master` ← **Head:** `filter-compare-logic` --- ### 📝 Commits (8) - [`7da5d00`](https://github.com/actualbudget/actual/commit/7da5d00c1c19a50f453dd0a68b78c672cc9a2852) update conditionExists function to compare filter options - [`8d230ee`](https://github.com/actualbudget/actual/commit/8d230ee382fcc234fa4d3e8a28702915d0c9e547) rename method - [`1387e06`](https://github.com/actualbudget/actual/commit/1387e06ef433e45ebab5f3da4275a18aec02f458) array.some instead of for loop - [`ca04f60`](https://github.com/actualbudget/actual/commit/ca04f60198f0517e7ea67b1c43c9a00fcd6801a4) release note - [`b99a54a`](https://github.com/actualbudget/actual/commit/b99a54ab1d9c98a6323638f6e6cedd792bc5b465) Merge branch 'master' into filter-compare-logic - [`ef166c7`](https://github.com/actualbudget/actual/commit/ef166c79bdf74a5f8a356d05cf815df3788d195c) Merge branch 'master' into filter-compare-logic - [`e810441`](https://github.com/actualbudget/actual/commit/e810441d0e2a7659e1e416313d9598bf6782c6b7) refactor the condition search - [`715666a`](https://github.com/actualbudget/actual/commit/715666a0f819f439f49910a4884f034a408552af) Merge branch 'master' into filter-compare-logic ### 📊 Changes **2 files changed** (+41 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `packages/loot-core/src/server/filters/app.ts` (+35 -27) ➕ `upcoming-release-notes/2970.md` (+6 -0) </details> ### 📄 Description Fixes #2937 Adds additional logic to the `conditionExists` function to also compare the`options` object. Fields like Amount, Amount (inflow), Amount (outflow) were matching as the same condition because their only difference lies within the options object: <img width="363" alt="image" src="https://github.com/actualbudget/actual/assets/4265864/2d120a43-1545-4d57-a311-b70b71008178"> I also refactored the logic to remove Array.map() in favor of Array.some() so that the loops can short circuit as soon as the condition is met. --- <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:58:32 -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#4615