[PR #5798] Propose patch for github issue 5680 #13182

Closed
opened 2026-04-10 21:49:04 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/5798

State: closed
Merged: No


aql: preserve inner in string literals; fix notes tag regex for (#5680)

Why:
This PR fixes an issue where filtering by notes tags containing a dollar sign ($) was broken. Previously, the AQL compiler aggressively unescaped all \$ occurrences in string literals, which incorrectly transformed user-intended regex patterns (e.g., \$end) into $end. This change ensures that \$ is only unescaped if it appears at the beginning of a string literal, preserving inner \$ for literal matching in regex patterns.

What:

  • packages/loot-core/src/server/aql/compiler.ts: Modified string literal unescaping to only target a leading \$.
  • packages/loot-core/src/server/aql/compiler.test.ts: Added a unit test to verify that inner \$ remains correctly escaped in compiled SQL for $regexp operations.

Open in Cursor Open in Web

**Original Pull Request:** https://github.com/actualbudget/actual/pull/5798 **State:** closed **Merged:** No --- <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> ### aql: preserve inner $ in string literals; fix notes tag regex for $ (#5680) **Why:** This PR fixes an issue where filtering by notes tags containing a dollar sign (`$`) was broken. Previously, the AQL compiler aggressively unescaped *all* `\$` occurrences in string literals, which incorrectly transformed user-intended regex patterns (e.g., `\$end`) into `$end`. This change ensures that `\$` is only unescaped if it appears at the *beginning* of a string literal, preserving inner `\$` for literal matching in regex patterns. **What:** * **`packages/loot-core/src/server/aql/compiler.ts`**: Modified string literal unescaping to only target a leading `\$`. * **`packages/loot-core/src/server/aql/compiler.test.ts`**: Added a unit test to verify that inner `\$` remains correctly escaped in compiled SQL for `$regexp` operations. --- <a href="https://cursor.com/background-agent?bcId=bc-eb16f07e-8f6c-4124-90cb-dd06adbf7760"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a href="https://cursor.com/agents?id=bc-eb16f07e-8f6c-4124-90cb-dd06adbf7760"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a>
GiteaMirror added the pull-request label 2026-04-10 21:49:04 -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#13182