[PR #3399] [MERGED] Fix regression in case sensitivity for is/matches operator #35028

Closed
opened 2026-04-20 22:04:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/3399
Author: @jfdoming
Created: 9/8/2024
Status: Merged
Merged: 9/28/2024
Merged by: @jfdoming

Base: masterHead: jfdoming/fix-case-sensitive-regexp-match


📝 Commits (9)

  • 55ff029 Fix regression in case sensitivity for is/matches operators
  • b58fea6 Add test
  • 5f6a356 Add release notes
  • 6cfff5a Fix failing tests
  • 8348614 Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match
  • 060d4bf Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match
  • d6c7e45 Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match
  • 7f84dc1 Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match
  • bf42f57 Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match

📊 Changes

11 files changed (+265 additions, -350 deletions)

View changed files

📝 packages/desktop-client/src/components/filters/FiltersMenu.jsx (+3 -3)
📝 packages/desktop-client/src/components/filters/updateFilterReducer.ts (+1 -1)
📝 packages/desktop-client/src/components/modals/EditRuleModal.jsx (+6 -4)
📝 packages/loot-core/src/server/accounts/rules.test.ts (+159 -208)
📝 packages/loot-core/src/server/accounts/rules.ts (+20 -45)
📝 packages/loot-core/src/server/accounts/transaction-rules.ts (+6 -28)
📝 packages/loot-core/src/server/rules/app.ts (+5 -25)
📝 packages/loot-core/src/server/schedules/app.ts (+1 -7)
📝 packages/loot-core/src/shared/rules.ts (+56 -29)
📝 packages/loot-core/src/types/models/rule.d.ts (+2 -0)
upcoming-release-notes/3399.md (+6 -0)

📄 Description

Fixes #3347.

A few changes here:

  • The actual bugfix is to remove the custom imported_payee field type in favour of reusing the logic for string. Instead, we do a two-stage mapping, from field to type and then from the type to the type-specific logic.
  • In order to facilitate the above, I removed the fieldTypes parameter to rule-related classes. The parameter always had the same value except in tests, so I just updated the tests to use the same types instead.

Steps to repro the issue on edge:

  1. Import a CSV with any transaction, making sure there is a valid "Imported Payee". example—note that with this CSV you'll need to select "Merchant" as the Payee.
  2. Go to create a rule, select "Imported payee", and select the contains op to start.
  3. Put the full payee name of the transaction in the value field and observe the transaction shows up as expected.
  4. Switch to matches or is with the same value and observe that there is now no match.

The same steps work as expected with this PR.


🔄 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/3399 **Author:** [@jfdoming](https://github.com/jfdoming) **Created:** 9/8/2024 **Status:** ✅ Merged **Merged:** 9/28/2024 **Merged by:** [@jfdoming](https://github.com/jfdoming) **Base:** `master` ← **Head:** `jfdoming/fix-case-sensitive-regexp-match` --- ### 📝 Commits (9) - [`55ff029`](https://github.com/actualbudget/actual/commit/55ff029de74fbc611882ca946936fe9764cd508f) Fix regression in case sensitivity for `is`/`matches` operators - [`b58fea6`](https://github.com/actualbudget/actual/commit/b58fea68f8ae087273bb99bfba3db56535e4b80f) Add test - [`5f6a356`](https://github.com/actualbudget/actual/commit/5f6a3566721299484ca0eabf9588723dcb8325ce) Add release notes - [`6cfff5a`](https://github.com/actualbudget/actual/commit/6cfff5a515917c5d04f7c5aad24e8dbd89411257) Fix failing tests - [`8348614`](https://github.com/actualbudget/actual/commit/834861462b52125603e08b870f59d5386d1a8d96) Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match - [`060d4bf`](https://github.com/actualbudget/actual/commit/060d4bf4750534695251198e1a4469bb7aa340da) Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match - [`d6c7e45`](https://github.com/actualbudget/actual/commit/d6c7e45f861e6d01d8a1a9c2fedcd81507be89b9) Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match - [`7f84dc1`](https://github.com/actualbudget/actual/commit/7f84dc1d20c8dc8e58c943b10739329c3edb85d6) Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match - [`bf42f57`](https://github.com/actualbudget/actual/commit/bf42f57c1d660646d74d37d3033b6cf3c9607a48) Merge branch 'master' into jfdoming/fix-case-sensitive-regexp-match ### 📊 Changes **11 files changed** (+265 additions, -350 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/components/filters/FiltersMenu.jsx` (+3 -3) 📝 `packages/desktop-client/src/components/filters/updateFilterReducer.ts` (+1 -1) 📝 `packages/desktop-client/src/components/modals/EditRuleModal.jsx` (+6 -4) 📝 `packages/loot-core/src/server/accounts/rules.test.ts` (+159 -208) 📝 `packages/loot-core/src/server/accounts/rules.ts` (+20 -45) 📝 `packages/loot-core/src/server/accounts/transaction-rules.ts` (+6 -28) 📝 `packages/loot-core/src/server/rules/app.ts` (+5 -25) 📝 `packages/loot-core/src/server/schedules/app.ts` (+1 -7) 📝 `packages/loot-core/src/shared/rules.ts` (+56 -29) 📝 `packages/loot-core/src/types/models/rule.d.ts` (+2 -0) ➕ `upcoming-release-notes/3399.md` (+6 -0) </details> ### 📄 Description Fixes #3347. A few changes here: - The actual bugfix is to remove the custom `imported_payee` field type in favour of reusing the logic for `string`. Instead, we do a two-stage mapping, from field to type and then from the type to the type-specific logic. - In order to facilitate the above, I removed the `fieldTypes` parameter to rule-related classes. The parameter always had the same value except in tests, so I just updated the tests to use the same types instead. Steps to repro the issue on edge: 1. Import a CSV with any transaction, making sure there is a valid "Imported Payee". [example](https://github.com/user-attachments/files/17006602/Test.matches.csv)—note that with this CSV you'll need to select "Merchant" as the Payee. 2. Go to create a rule, select "Imported payee", and select the `contains` op to start. 3. Put the full payee name of the transaction in the value field and observe the transaction shows up as expected. 4. Switch to `matches` or `is` with the same value and observe that there is now no match. The same steps work as expected with this PR. --- <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-04-20 22:04:42 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#35028