[PR #7270] [MERGED] Fix/5840 escape search wildcards #14107

Closed
opened 2026-04-10 22:13:23 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/7270
Author: @eduardopio03
Created: 3/23/2026
Status: Merged
Merged: 4/8/2026
Merged by: @matt-fidd

Base: masterHead: fix/5840-escape-search-wildcards


📝 Commits (10+)

  • e4c9757 Escape LIKE wildcards; support ? in unicodeLike
  • 7023d02 add release notes
  • d8a2843 [autofix.ci] apply automated fixes
  • 6e27586 Revert "[autofix.ci] apply automated fixes"
  • 08e5a80 [autofix.ci] apply automated fixes
  • e01706d fix: address bot review feedback for escapes
  • ead1025 Merge branch 'master' into fix/5840-escape-search-wildcards
  • ebbeb06 Support escaped backslash
  • afc32de Add tests for escaped characters in unicodeLike
  • 4ea8bda [autofix.ci] apply automated fixes

📊 Changes

4 files changed (+57 additions, -20 deletions)

View changed files

📝 packages/desktop-client/src/queries/index.ts (+6 -5)
📝 packages/loot-core/src/platform/server/sqlite/unicodeLike.test.ts (+14 -0)
📝 packages/loot-core/src/platform/server/sqlite/unicodeLike.ts (+31 -15)
upcoming-release-notes/7270.md (+6 -0)

📄 Description

Description

When a user types special characters such as ? or % into the transaction quick search bar, all transactions were returned instead of only those matching the literal character. This happened because these characters were being passed unescaped into $like query patterns, where they acted as regex wildcards inside the custom UNICODE_LIKE function.

The fix has two parts:

  • In transactionsSearch (index.ts), the search string is now escaped before being used in $like patterns, so ? and % are prefixed with \ to signal they should be treated as literals.
  • In unicodeLike.ts, the pattern-to-regex converter is updated to recognise these escape sequences and convert them to properly escaped regex literals instead of wildcards. This directly addresses the TODO comment already present in that file.

Fixes #5840

Testing

  1. Create a transaction with ? or % in the notes or payee name field.
  2. Open the transaction view and type ? or % in the quick search bar.
  3. Before fix: all transactions are shown.
  4. After fix: only transactions containing the literal ? or % are shown.
  5. Verify that normal searches (e.g. plain text, amounts, dates) still work correctly.

Checklist

  • Release notes added (see link above)
  • No obvious regressions in affected areas
  • Self-review has been performed - I understand what each change in the code does and why it is needed

Bundle Stats

Bundle Files count Total bundle size % Changed
desktop-client 27 12.41 MB → 12.41 MB (+93 B) +0.00%
loot-core 1 4.84 MB → 4.84 MB (+466 B) +0.01%
api 1 3.83 MB → 3.84 MB (+446 B) +0.01%
cli 1 7.89 MB 0%
View detailed bundle stats

desktop-client

Total

Files count Total bundle size % Changed
27 12.41 MB → 12.41 MB (+93 B) +0.00%
Changeset
File Δ Size
src/queries/index.ts 📈 +93 B (+4.26%) 2.13 kB → 2.22 kB
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
static/js/useTransactionBatchActions.js 4.33 MB → 4.33 MB (+93 B) +0.00%

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
static/js/index.js 3.31 MB 0%
static/js/BackgroundImage.js 121.09 kB 0%
static/js/FormulaEditor.js 852.77 kB 0%
static/js/ReportRouter.js 1.17 MB 0%
static/js/TransactionList.js 82.49 kB 0%
static/js/ca.js 189.75 kB 0%
static/js/da.js 104.66 kB 0%
static/js/de.js 174.38 kB 0%
static/js/en-GB.js 8.2 kB 0%
static/js/en.js 175.65 kB 0%
static/js/es.js 181.8 kB 0%
static/js/fr.js 177.08 kB 0%
static/js/indexeddb-main-thread-worker-e59fee74.js 13.46 kB 0%
static/js/it.js 165.87 kB 0%
static/js/narrow.js 363.02 kB 0%
static/js/nb-NO.js 151.85 kB 0%
static/js/nl.js 108.93 kB 0%
static/js/pl.js 88.34 kB 0%
static/js/pt-BR.js 177.44 kB 0%
static/js/resize-observer.js 18.06 kB 0%
static/js/th.js 179.3 kB 0%
static/js/theme.js 30.79 kB 0%
static/js/uk.js 212.6 kB 0%
static/js/wide.js 295 B 0%
static/js/workbox-window.prod.es5.js 7.33 kB 0%
static/js/zh-Hans.js 94.19 kB 0%

loot-core

Total

Files count Total bundle size % Changed
1 4.84 MB → 4.84 MB (+466 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/platform/server/sqlite/unicodeLike.ts 📈 +466 B (+84.88%) 549 B → 1015 B
View detailed bundle breakdown

Added

Asset File Size % Changed
kcab.worker.BNveTyqm.js 0 B → 4.84 MB (+4.84 MB) -

Removed

Asset File Size % Changed
kcab.worker.B7SvglID.js 4.84 MB → 0 B (-4.84 MB) -100%

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged
No assets were unchanged


api

Total

Files count Total bundle size % Changed
1 3.83 MB → 3.84 MB (+446 B) +0.01%
Changeset
File Δ Size
home/runner/work/actual/actual/packages/loot-core/src/platform/server/sqlite/unicodeLike.ts 📈 +446 B (+81.54%) 547 B → 993 B
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger

Asset File Size % Changed
index.js 3.83 MB → 3.84 MB (+446 B) +0.01%

Smaller
No assets were smaller

Unchanged
No assets were unchanged


cli

Total

Files count Total bundle size % Changed
1 7.89 MB 0%
View detailed bundle breakdown

Added
No assets were added

Removed
No assets were removed

Bigger
No assets were bigger

Smaller
No assets were smaller

Unchanged

Asset File Size % Changed
cli.js 7.89 MB 0%

🔄 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/7270 **Author:** [@eduardopio03](https://github.com/eduardopio03) **Created:** 3/23/2026 **Status:** ✅ Merged **Merged:** 4/8/2026 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `fix/5840-escape-search-wildcards` --- ### 📝 Commits (10+) - [`e4c9757`](https://github.com/actualbudget/actual/commit/e4c9757f83808a3bc8305224f52ff6b03af8e5e5) Escape LIKE wildcards; support ? in unicodeLike - [`7023d02`](https://github.com/actualbudget/actual/commit/7023d0275a5daa38b218f2e4bbeead23702206a3) add release notes - [`d8a2843`](https://github.com/actualbudget/actual/commit/d8a2843a5ba5c17d24cda53370757850eeb0346a) [autofix.ci] apply automated fixes - [`6e27586`](https://github.com/actualbudget/actual/commit/6e27586eee6e4550d858804eba10a163a84868e3) Revert "[autofix.ci] apply automated fixes" - [`08e5a80`](https://github.com/actualbudget/actual/commit/08e5a8098f416401815b4df3549e93447538608e) [autofix.ci] apply automated fixes - [`e01706d`](https://github.com/actualbudget/actual/commit/e01706d1abd2a616b752a0dd0d004d3edd56e770) fix: address bot review feedback for escapes - [`ead1025`](https://github.com/actualbudget/actual/commit/ead10255c791c4aae23525ae35b367a8dd396792) Merge branch 'master' into fix/5840-escape-search-wildcards - [`ebbeb06`](https://github.com/actualbudget/actual/commit/ebbeb06ba9d1896782f14a378eb3cb0f3285212d) Support escaped backslash - [`afc32de`](https://github.com/actualbudget/actual/commit/afc32defa9709b9e56e6dd0fb730479f41e8cd6a) Add tests for escaped characters in unicodeLike - [`4ea8bda`](https://github.com/actualbudget/actual/commit/4ea8bdafb91ffd20fbf52a653455f427055eace5) [autofix.ci] apply automated fixes ### 📊 Changes **4 files changed** (+57 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `packages/desktop-client/src/queries/index.ts` (+6 -5) 📝 `packages/loot-core/src/platform/server/sqlite/unicodeLike.test.ts` (+14 -0) 📝 `packages/loot-core/src/platform/server/sqlite/unicodeLike.ts` (+31 -15) ➕ `upcoming-release-notes/7270.md` (+6 -0) </details> ### 📄 Description ## Description When a user types special characters such as ? or % into the transaction quick search bar, all transactions were returned instead of only those matching the literal character. This happened because these characters were being passed unescaped into $like query patterns, where they acted as regex wildcards inside the custom UNICODE_LIKE function. The fix has two parts: - In transactionsSearch (index.ts), the search string is now escaped before being used in $like patterns, so ? and % are prefixed with \ to signal they should be treated as literals. - In unicodeLike.ts, the pattern-to-regex converter is updated to recognise these escape sequences and convert them to properly escaped regex literals instead of wildcards. This directly addresses the TODO comment already present in that file. ## Related issue(s) Fixes #5840 ## Testing 1. Create a transaction with ? or % in the notes or payee name field. 2. Open the transaction view and type ? or % in the quick search bar. 3. Before fix: all transactions are shown. 4. After fix: only transactions containing the literal ? or % are shown. 5. Verify that normal searches (e.g. plain text, amounts, dates) still work correctly. ## Checklist - [x] Release notes added (see link above) - [x] No obvious regressions in affected areas - [x] Self-review has been performed - I understand what each change in the code does and why it is needed <!--- actual-bot-sections ---> <hr /> <!--- bundlestats-action-comment key:combined start ---> ### Bundle Stats Bundle | Files count | Total bundle size | % Changed ------ | ----------- | ----------------- | --------- desktop-client | 27 | 12.41 MB → 12.41 MB (+93 B) | +0.00% loot-core | 1 | 4.84 MB → 4.84 MB (+466 B) | +0.01% api | 1 | 3.83 MB → 3.84 MB (+446 B) | +0.01% cli | 1 | 7.89 MB | 0% <details> <summary>View detailed bundle stats</summary> #### desktop-client **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 27 | 12.41 MB → 12.41 MB (+93 B) | +0.00% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `src/queries/index.ts` | 📈 +93 B (+4.26%) | 2.13 kB → 2.22 kB </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- static/js/useTransactionBatchActions.js | 4.33 MB → 4.33 MB (+93 B) | +0.00% **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- static/js/index.js | 3.31 MB | 0% static/js/BackgroundImage.js | 121.09 kB | 0% static/js/FormulaEditor.js | 852.77 kB | 0% static/js/ReportRouter.js | 1.17 MB | 0% static/js/TransactionList.js | 82.49 kB | 0% static/js/ca.js | 189.75 kB | 0% static/js/da.js | 104.66 kB | 0% static/js/de.js | 174.38 kB | 0% static/js/en-GB.js | 8.2 kB | 0% static/js/en.js | 175.65 kB | 0% static/js/es.js | 181.8 kB | 0% static/js/fr.js | 177.08 kB | 0% static/js/indexeddb-main-thread-worker-e59fee74.js | 13.46 kB | 0% static/js/it.js | 165.87 kB | 0% static/js/narrow.js | 363.02 kB | 0% static/js/nb-NO.js | 151.85 kB | 0% static/js/nl.js | 108.93 kB | 0% static/js/pl.js | 88.34 kB | 0% static/js/pt-BR.js | 177.44 kB | 0% static/js/resize-observer.js | 18.06 kB | 0% static/js/th.js | 179.3 kB | 0% static/js/theme.js | 30.79 kB | 0% static/js/uk.js | 212.6 kB | 0% static/js/wide.js | 295 B | 0% static/js/workbox-window.prod.es5.js | 7.33 kB | 0% static/js/zh-Hans.js | 94.19 kB | 0% </div> </details> --- #### loot-core **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 4.84 MB → 4.84 MB (+466 B) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/platform/server/sqlite/unicodeLike.ts` | 📈 +466 B (+84.88%) | 549 B → 1015 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.BNveTyqm.js | 0 B → 4.84 MB (+4.84 MB) | - **Removed** Asset | File Size | % Changed ----- | --------- | --------- kcab.worker.B7SvglID.js | 4.84 MB → 0 B (-4.84 MB) | -100% **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### api **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 3.83 MB → 3.84 MB (+446 B) | +0.01% <details> <summary>Changeset</summary> File | Δ | Size ---- | - | ---- `home/runner/work/actual/actual/packages/loot-core/src/platform/server/sqlite/unicodeLike.ts` | 📈 +446 B (+81.54%) | 547 B → 993 B </details> <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** Asset | File Size | % Changed ----- | --------- | --------- index.js | 3.83 MB → 3.84 MB (+446 B) | +0.01% **Smaller** No assets were smaller **Unchanged** No assets were unchanged </div> </details> --- #### cli **Total** Files count | Total bundle size | % Changed ----------- | ----------------- | --------- 1 | 7.89 MB | 0% <details> <summary>View detailed bundle breakdown</summary> <div> **Added** No assets were added **Removed** No assets were removed **Bigger** No assets were bigger **Smaller** No assets were smaller **Unchanged** Asset | File Size | % Changed ----- | --------- | --------- cli.js | 7.89 MB | 0% </div> </details> </details> <!--- bundlestats-action-comment key:combined end ---> --- <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-10 22:13:23 -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#14107