Skip to content

[Due for payment 2026-09-01] Search query values containing commas or quotes are not handled comprehensively #98374

Closed

Description

@Julesssss

Problem

Search query values are handled by two independent mechanisms, and each has a distinct defect. PR 97083 worked around both for the autocomplete-selection path only.

1. The query grammar has no escape syntax. A quoted value is parsed by simpleQuotedString (src/libs/SearchParser/baseRules.peggy), whose inner match excludes quote characters entirely — so a workspace:/in: value containing a quote (e.g. Acme "US",Inc) cannot be represented at all. Name filters (from:, to:, payer:, …) use nestedQuotedString, which tolerates embedded quotes via a closing-quote lookahead heuristic, not escaping. The PR works around this by stripping quotes from values (stripSearchValueQuotes), which is lossy.

2. Typed values are never resolved to IDs. Name→ID substitution (getQueryWithSubstitutions) only applies to entries in the substitution map, which is populated exclusively by autocomplete selection. A hand-typed workspace:"Acme, Inc" parses fine but submits the literal name as the policyID, returning "Nothing to show". This is a resolution gap, not a parsing gap — fixing the grammar alone does not fix it.

Related constraint: the comma is both a legal value character and the multi-value delimiter (columns:a,b), so comma-quoting had to be opt-in (sanitizeSearchValue(str, shouldQuoteComma)) — quoting is not uniform across the language.

Solution

  • Add escape syntax to the shared grammar (baseRules.peggy, consumed by both searchParser and autocompleteParser in lockstep) so any value round-trips under any filter key; must not break persisted queries (saved searches, q= URLs)
  • Resolve hand-typed workspace/room names to IDs at submit time when absent from the substitution map (needs a decision on duplicate names and case sensitivity)
  • Delete the getParsableSearchValue/stripSearchValueQuotes workarounds
Issue OwnerCurrent Issue Owner: @mallenexpensify

Activity

  1. self-assigned this
    on Aug 11, 2026
  2. Julesssss commented on Aug 11, 2026

    @Julesssss
    ContributorAuthor

    Hi @mukhrr would you be interested in working on a follow up to #97083?

  3. mukhrr commented on Aug 11, 2026

    @mukhrr
    Contributor

    Hi @mukhrr would you be interested in working on a follow up to #97083?

    Sure! Thanks

  4. mukhrr commented on Aug 13, 2026

    @mukhrr
    Contributor

    @Julesssss PR is ready. Let's get C+ (hopefully @parasharrajat) assigned to review. thanks

  5. Julesssss commented on Aug 15, 2026

    @Julesssss
    ContributorAuthor

    Hey @parasharrajat just checking if you're interested in this C+ review, or else I can auto-assign

  6. parasharrajat commented on Aug 15, 2026

    @parasharrajat
    Member

    Sounds good.

  7. 11 remaining items

  8. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Aug 28, 2026
  9. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  10. melvin-bot commented on Aug 31, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  11. mallenexpensify commented on Sep 3, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor: @mukhrr due $250 via NewDot
    Contributor+: @parasharrajat due $250 via NewDot

  12. m-natarajan commented on Sep 8, 2026

    @m-natarajan

    @parasharrajat This is regarding the Regression test proposal
    Can you clarify step 2, Workspace filter is not showing that workspace as selected. Step 4 is a pass. Is this expected?

    Recording.3487.mp4
  13. parasharrajat commented on Sep 8, 2026

    @parasharrajat
    Member

    In this vid, you have not provided correct workspace name. You missed to add the closing "

  14. flaviadefaria commented on Sep 11, 2026

    @flaviadefaria
    Contributor

    Approved: @mukhrr owed $250 via NewDot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2EngineeringImprovementItem broken or needs improvement.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions