Skip to content

fix(orders): keep FTS search candidates a superset of Unicode queries - #1262

Merged
khaira777 merged 4 commits into
mainfrom
fm/remediate-n4-unicode-search
Oct 21, 2026
Merged

khaira777 merged 4 commits into
mainfrom
fm/remediate-n4-unicode-search

Conversation

@khaira777

@khaira777 khaira777 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1256

Intent

Fix finding N4 (GitHub issue #1256) in FreeOpenSourcePOS/FloCafe: in GET /api/orders (main/routes/orders.ts), keep SQLite FTS5 trigram search candidates a strict superset of authoritative JavaScript orders_search_contains matches by restricting hasFts candidate pre-filtering to printable ASCII queries of length >= 3 that cannot fold across Turkish dotted capital İ (/^[\x20-\x7E]+$/.test(search) && !/[iI]$/.test(search) && search.length >= 3) and using the existing udfClause fallback for non-ASCII Unicode queries (such as Georgian აბგ matching ᲐᲑᲒ and Turkish decomposed i\u0307st matching İstanbul) and trailing-i/I queries (such as "ali" matching "ALİ"), while preserving the FTS5 trigram fast path for ASCII order, customer, and phone searches.

What Changed

  • Restricted GET /api/orders FTS search candidate pre-filtering to printable ASCII queries of length >= 3 that do not end in i or I.
  • Routed non-ASCII Unicode searches and queries ending in i/I to the SQLite UDF fallback to preserve case-folded matches across Turkish and Georgian scripts.
  • Added API integration tests in tests/orders-search-api.test.ts verifying order number and customer name searches for Georgian case variants, Turkish decomposed characters, and trailing-i queries.

Risk Assessment

✅ Low: The change is minimal, surgical, and directly implements the authorized user intent by restricting FTS candidate pre-filtering to ASCII queries not ending in 'i'/'I' while delegating Unicode queries to the authoritative UDF search fallback.

Testing

Exercised the live Express API on port 3001 and the automated test suite for GET /api/orders search functionality across 7 targeted scenarios: non-ASCII Georgian Mtavruli/Mkhedruli queries, Turkish decomposed lowercase queries matching uppercase dotted capital İ, trailing ASCII i/I queries routed to UDF fallback to avoid FTS5 case folding mismatches, non-ASCII order number searches, ASCII FTS5 trigram fast-path queries (orders, customer names, and phone digits), adversarial trailing-i vs non-i routing, and short/control-character query boundaries. All live scenarios and test suites passed with HTTP 200 responses and verified order matches without regressions.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Non-ASCII Unicode search for Georgian Mkhedruli script returns order with Georgian Mtavruli customer name ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_1_georgian_search.json
Non-ASCII Unicode search for decomposed Turkish lowercase returns order with composed dotted capital customer name ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_2_turkish_decomposed_search.json
Trailing ASCII i query bypasses FTS5 trigram pre-filtering and matches Turkish customer with uppercase dotted İ ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_3_turkish_trailing_i_search.json
Non-ASCII Unicode order number search returns orders with non-ASCII identifiers via UDF fallback ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_4_non_ascii_order_number_search.json
Printable ASCII queries of length >= 3 not ending in i/I preserve FTS5 trigram fast path for orders, customers, and phone digits ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_5_ascii_fts_fastpath_search.json
Adversarial boundary check for queries ending in i/I (bypassing FTS) vs non-i queries (using FTS) ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_6_boundary_trailing_i_vs_non_i.json
Adversarial boundary check for short queries (< 3 chars) and queries containing control characters ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_7_boundary_short_and_control_chars.json
Evidence: Live HTTP validation run log
[LiveDriver] Initializing isolated SQLite database at: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/flo-live-val-RgpyGr
[DB] Opening database at: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/flo-live-val-RgpyGr/flo.db
[DB] Schema: v0 → v115
[DB] Triggering auto-backup before migrating v0 → v115...
[DB] Auto-backup before migrating v0 → v115 created at /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/flo-live-val-RgpyGr/backups/flo-backup-2026-10-21T06-28-44-748Z-pre-v0-to-v115.db
[DB] Install defaults loaded; first-run setup pending
[MIGRATION v23] normalized: 0, unparseable: 0
[MIGRATION v23] merged 0 duplicate customer(s)
[MIGRATION v23] verification: 0 customers, 0 still non-E.164
[MIGRATION v24] normalized: 0, unparseable: 0
[MIGRATION v25] backfilled addons for 0 order items (0 unparseable, skipped)
[MIGRATION v30] backfilled 0 order_item(s) still missing a normalized addons snapshot
[MIGRATION v30] Dropped order_items.addons — order_item_addons is now the only place selected addons live.
[MIGRATION v73] normalized 0 merchant template payload(s); 0 already canonical or left untouched
[DB] integrity_check: ok
[DB] foreign_key_check: clean
[LiveDriver] Starting Express HTTP server...
[Server] Frontend build not found. Run `npm run build:frontend` first.
[Server] HTTP server running on http://localhost:3001
[KDS] WebSocket server setup complete
[Server] KDS WebSocket running on ws://localhost:3001/kds
[WhatsApp] {"event":"startup_init","enabled":false,"hasCredentials":false,"connectedPhone":null}
[LiveDriver] Server listening on http://127.0.0.1:3001

--- Scenario 1: Georgian Script Search ---
  Query: "აბგ", Status: 200, Found ORD-GEORGIAN: true, Time: 406.52ms

--- Scenario 2: Decomposed Unicode Turkish Search ---
  Query: "i̇st" (decomposed i\u0307st), Status: 200, Found ORD-TURKISH-ISTANBUL: true, Time: 12.71ms

--- Scenario 3: Trailing ASCII i Matching Turkish ALİ ---
  Query: "ali", Status: 200, Found ORD-TURKISH-DOT: true, Time: 9.00ms

--- Scenario 4: Non-ASCII Order Number Searches ---
  Query "აბგ-100": found ORD-ᲐᲑᲒ-100: true
  Query "i̇st-200": found ORD-İST-200: true

--- Scenario 5: Printable ASCII >= 3 Chars FTS Fast Path ---
  Query "ORD-SYNTH": found ORD-SYNTH-ZOE: true
  Query "Shaun": found ORD-SYNTH-OCONNOR: true
  Query "5550199": found ORD-SEARCH-OLDER: true

--- Scenario 6 (Adversarial): Queries ending in i/I vs not ending in i/I ---
  Query "ELI" (ends in 'I', bypasses FTS): found ORD-ASCII-ELI: true
  Query "alex" (ends in 'x', uses FTS): found ORD-ASCII-ALEX: true

--- Scenario 7 (Adversarial): Short queries and control characters ---
  Short query "al" (< 3 chars): status 200, found: true
  Control char query with embedded tab: status 200, found: true
  Control char query with newline/CR/DEL: status 200 (no 500 error)

[LiveDriver] Validation completed. All scenarios passed: true
[LiveDriver] Stopping server...
[Server] HTTP/WebSocket server stopped
[DB] Database closed
[LiveDriver] Teardown complete.
Evidence: Live scenarios summary JSON
{
  "verdict": "PASS",
  "timestamp": "2026-10-21T06:28:45.566Z",
  "totalScenarios": 7,
  "passedScenarios": 7,
  "scenarios": [
    {
      "scenario": "Scenario 1: Non-ASCII Georgian Mkhedruli query matches Georgian Mtavruli customer",
      "query": "აბგ",
      "httpStatus": 200,
      "elapsedMs": 406.5201670000006,
      "orderFound": true,
      "matchedOrders": [
        {
          "order_number": "ORD-ᲐᲑᲒ-100",
          "customer": null
        },
        {
          "order_number": "ORD-GEORGIAN",
          "customer": {
            "id": "cust-georgian",
            "name": "ᲐᲑᲒ",
            "email": null,
            "phone": "+995 32 200 0001",
            "country_code": "+91",
            "address": null,
            "notes": null,
            "tag_counts": null,
            "is_active": 1,
            "created_at": "2026-10-21 06:28:45",
            "updated_at": "2026-10-21 06:28:45",
            "phone_digits": "995322000001"
          }
        }
      ],
      "pass": true
    },
    {
      "scenario": "Scenario 2: Decomposed Unicode Turkish lowercase query matches composed dotted capital customer",
      "query": "i\\u0307st",
      "httpStatus": 200,
      "elapsedMs": 12.711790999999721,
      "orderFound": true,
      "matchedOrders": [
        {
          "order_number": "ORD-İST-200",
          "customer": null
        },
        {
          "order_number": "ORD-TURKISH-ISTANBUL",
          "customer": {
            "id": "cust-turkish-istanbul",
            "name": "İstanbul",
            "email": null,
            "phone": "+90 212 000 0001",
            "country_code": "+91",
            "address": null,
            "notes": null,
            "tag_counts": null,
            "is_active": 1,
            "created_at": "2026-10-21 06:28:45",
            "updated_at": "2026-10-21 06:28:45",
            "phone_digits": "902120000001"
          }
        }
      ],
      "pass": true
    },
    {
      "scenario": "Scenario 3: Trailing ASCII i query matches customer ALİ with Turkish dotted capital İ",
      "query": "ali",
      "httpStatus": 200,
      "elapsedMs": 9.001207999999679,
      "orderFound": true,
      "matchedOrders": [
        {
          "order_number": "ORD-TURKISH-DOT",
          "customer": {
            "id": "cust-turkish-ali",
            "name": "ALİ",
            "email": null,
            "phone": "+90 212 000 0002",
            "country_code": "+91",
            "address": null,
            "notes": null,
            "tag_counts": null,
            "is_active": 1,
            "created_at": "2026-10-21 06:28:45",
            "updated_at": "2026-10-21 06:28:45",
            "phone_digits": "902120000002"
          }
        }
      ],
      "pass": true
    },
    {
      "scenario": "Scenario 4: Non-ASCII Unicode order number searches (Georgian & Turkish)",
      "queries": [
        {
          "query": "აბგ-100",
          "status": 200,
          "found": true,
          "matchedOrders": [
            {
              "id": 4,
              "order_number": "ORD-ᲐᲑᲒ-100",
              "table_id": null,
              "customer_id": null,
              "user_id": null,
              "type": "takeaway",
              "delivery_address": null,
              "expected_payment_method": null,
              "delivery_note": null,
              "guest_count": null,
              "special_instructions": null,
              "packaging_charge": 0,
              "delivery_charge": 0,
              "service_charge": 0,
              "charges_breakdown": null,
              "status": "completed",
              "subtotal": 100,
              "tax_amount": 0,
              "tax_breakdown": null,
              "tax_snapshot": null,
              "packaging_tax_category_id": null,
              "delivery_tax_category_id": null,
              "service_charge_tax_category_id": null,
              "discount_amount": 0,
              "discount_type": null,
              "discount_value": null,
              "discount_reason": null,
              "round_off": 0,
              "total": 100,
              "cooking_started_at": null,
              "ready_at": null,
              "served_at": null,
              "completed_at": null,
              "cancelled_at": null,
              "cancellation_reason": null,
              "created_at": "2023-01-01 00:00:00",
              "updated_at": "2023-01-01 00:00:00",
              "online_platform": null,
              "external_order_id": null,
              "expected_payment_method_id": null,
              "items": [],
              "table": null,
              "customer": null,
              "bill": null,
              "bills": [],
              "whatsapp_receipt_status": null
            }
          ]
        },
        {
          "query": "i\\u0307st-200",
          "status": 200,
          "found": true,
          "matchedOrders": [
            {
              "id": 5,
              "order_number": "ORD-İST-200",
              "table_id": null,
              "customer_id": null,
              "user_id": null,
              "type": "takeaway",
              "delivery_address": null,
              "expected_payment_method": null,
              "delivery_note": null,
              "guest_count": null,
              "special_instructions": null,
              "packaging_charge": 0,
              "delivery_charge": 0,
              "service_charge": 0,
              "charges_breakdown": null,
              "status": "completed",
              "subtotal": 100,
              "tax_amount": 0,
              "tax_breakdown": null,
              "tax_snapshot": null,
              "packaging_tax_category_id": null,
              "delivery_tax_category_id": null,
              "service_charge_tax_category_id": null,
              "discount_amount": 0,
              "discount_type": null,
              "discount_value": null,
              "discount_reason": null,
              "round_off": 0,
              "total": 100,
              "cooking_started_at": null,
              "ready_at": null,
              "served_at": null,
              "completed_at": null,
              "cancelled_at": null,
              "cancellation_reason": null,
              "created_at": "2023-01-01 00:00:00",
              "updated_at": "2023-01-01 00:00:00",
              "online_platform": null,
              "external_order_id": null,
              "expected_payment_method_id": null,
              "items": [],
              "table": null,
              "customer": null,
              "bill": null,
              "bills": [],
              "whatsapp_receipt_status": null
            }
          ]
        }
      ],
      "pass": true
    },
    {
      "scenario": "Scenario 5: Printable ASCII query >= 3 characters preserves FTS5 trigram fast path",
      "checks": [
        {
          "query": "ORD-SYNTH",
          "status": 200,
          "found": true,
          "count": 3
        },
        {
          "query": "Shaun",
          "status": 200,
          "found": true,
          "count": 1
        },
        {
          "query": "5550199",
          "status": 200,
          "found": true,
          "count": 1
        }
      ],
      "pass": true
    },
    {
      "scenario": "Scenario 6 (Adversarial / Boundary): Queries ending in i/I bypass FTS while non-i queries use FTS",
      "checks": [
        {
          "query": "ELI",
          "endsInI": true,
          "expectedFts": false,
          "status": 200,
          "found": true
        },
        {
          "query": "alex",
          "endsInI": false,
          "expectedFts": true,
          "status": 200,
          "found": true
        }
      ],
      "pass": true
    },
    {
      "scenario": "Scenario 7 (Adversarial / Boundary): Short queries (< 3 chars) and control characters fall back safely",
      "checks": [
        {
          "query": "al",
          "length": 2,
          "status": 200,
          "found": true
        },
        {
          "query": "ORD-SYNTH-TAB\\t123",
          "status": 200,
          "found": true
        },
        {
          "query": "test\\n\\r\\x7F",
          "status": 200,
          "noError": true
        }
      ],
      "pass": true
    }
  ]
}
Evidence: Scenario 1 Georgian script search result
{
  "scenario": "Scenario 1: Non-ASCII Georgian Mkhedruli query matches Georgian Mtavruli customer",
  "query": "აბგ",
  "httpStatus": 200,
  "elapsedMs": 406.5201670000006,
  "orderFound": true,
  "matchedOrders": [
    {
      "order_number": "ORD-ᲐᲑᲒ-100",
      "customer": null
    },
    {
      "order_number": "ORD-GEORGIAN",
      "customer": {
        "id": "cust-georgian",
        "name": "ᲐᲑᲒ",
        "email": null,
        "phone": "+995 32 200 0001",
        "country_code": "+91",
        "address": null,
        "notes": null,
        "tag_counts": null,
        "is_active": 1,
        "created_at": "2026-10-21 06:28:45",
        "updated_at": "2026-10-21 06:28:45",
        "phone_digits": "995322000001"
      }
    }
  ],
  "pass": true
}
Evidence: Scenario 2 Turkish decomposed query search result
{
  "scenario": "Scenario 2: Decomposed Unicode Turkish lowercase query matches composed dotted capital customer",
  "query": "i\\u0307st",
  "httpStatus": 200,
  "elapsedMs": 12.711790999999721,
  "orderFound": true,
  "matchedOrders": [
    {
      "order_number": "ORD-İST-200",
      "customer": null
    },
    {
      "order_number": "ORD-TURKISH-ISTANBUL",
      "customer": {
        "id": "cust-turkish-istanbul",
        "name": "İstanbul",
        "email": null,
        "phone": "+90 212 000 0001",
        "country_code": "+91",
        "address": null,
        "notes": null,
        "tag_counts": null,
        "is_active": 1,
        "created_at": "2026-10-21 06:28:45",
        "updated_at": "2026-10-21 06:28:45",
        "phone_digits": "902120000001"
      }
    }
  ],
  "pass": true
}
Evidence: Scenario 3 Turkish trailing-i query search result
{
  "scenario": "Scenario 3: Trailing ASCII i query matches customer ALİ with Turkish dotted capital İ",
  "query": "ali",
  "httpStatus": 200,
  "elapsedMs": 9.001207999999679,
  "orderFound": true,
  "matchedOrders": [
    {
      "order_number": "ORD-TURKISH-DOT",
      "customer": {
        "id": "cust-turkish-ali",
        "name": "ALİ",
        "email": null,
        "phone": "+90 212 000 0002",
        "country_code": "+91",
        "address": null,
        "notes": null,
        "tag_counts": null,
        "is_active": 1,
        "created_at": "2026-10-21 06:28:45",
        "updated_at": "2026-10-21 06:28:45",
        "phone_digits": "902120000002"
      }
    }
  ],
  "pass": true
}
Evidence: Scenario 4 Non-ASCII order number searches result
{
  "scenario": "Scenario 4: Non-ASCII Unicode order number searches (Georgian & Turkish)",
  "queries": [
    {
      "query": "აბგ-100",
      "status": 200,
      "found": true,
      "matchedOrders": [
        {
          "id": 4,
          "order_number": "ORD-ᲐᲑᲒ-100",
          "table_id": null,
          "customer_id": null,
          "user_id": null,
          "type": "takeaway",
          "delivery_address": null,
          "expected_payment_method": null,
          "delivery_note": null,
          "guest_count": null,
          "special_instructions": null,
          "packaging_charge": 0,
          "delivery_charge": 0,
          "service_charge": 0,
          "charges_breakdown": null,
          "status": "completed",
          "subtotal": 100,
          "tax_amount": 0,
          "tax_breakdown": null,
          "tax_snapshot": null,
          "packaging_tax_category_id": null,
          "delivery_tax_category_id": null,
          "service_charge_tax_category_id": null,
          "discount_amount": 0,
          "discount_type": null,
          "discount_value": null,
          "discount_reason": null,
          "round_off": 0,
          "total": 100,
          "cooking_started_at": null,
          "ready_at": null,
          "served_at": null,
          "completed_at": null,
          "cancelled_at": null,
          "cancellation_reason": null,
          "created_at": "2023-01-01 00:00:00",
          "updated_at": "2023-01-01 00:00:00",
          "online_platform": null,
          "external_order_id": null,
          "expected_payment_method_id": null,
          "items": [],
          "table": null,
          "customer": null,
          "bill": null,
          "bills": [],
          "whatsapp_receipt_status": null
        }
      ]
    },
    {
      "query": "i\\u0307st-200",
      "status": 200,
      "found": true,
      "matchedOrders": [
        {
          "id": 5,
          "order_number": "ORD-İST-200",
          "table_id": null,
          "customer_id": null,
          "user_id": null,
          "type": "takeaway",
          "delivery_address": null,
          "expected_payment_method": null,
          "delivery_note": null,
          "guest_count": null,
          "special_instructions": null,
          "packaging_charge": 0,
          "delivery_charge": 0,
          "service_charge": 0,
          "charges_breakdown": null,
          "status": "completed",
          "subtotal": 100,
          "tax_amount": 0,
          "tax_breakdown": null,
          "tax_snapshot": null,
          "packaging_tax_category_id": null,
          "delivery_tax_category_id": null,
          "service_charge_tax_category_id": null,
          "discount_amount": 0,
          "discount_type": null,
          "discount_value": null,
          "discount_reason": null,
          "round_off": 0,
          "total": 100,
          "cooking_started_at": null,
          "ready_at": null,
          "served_at": null,
          "completed_at": null,
          "cancelled_at": null,
          "cancellation_reason": null,
          "created_at": "2023-01-01 00:00:00",
          "updated_at": "2023-01-01 00:00:00",
          "online_platform": null,
          "external_order_id": null,
          "expected_payment_method_id": null,
          "items": [],
          "table": null,
          "customer": null,
          "bill": null,
          "bills": [],
          "whatsapp_receipt_status": null
        }
      ]
    }
  ],
  "pass": true
}
Evidence: Scenario 5 ASCII FTS5 trigram fast-path query result
{
  "scenario": "Scenario 5: Printable ASCII query >= 3 characters preserves FTS5 trigram fast path",
  "checks": [
    {
      "query": "ORD-SYNTH",
      "status": 200,
      "found": true,
      "count": 3
    },
    {
      "query": "Shaun",
      "status": 200,
      "found": true,
      "count": 1
    },
    {
      "query": "5550199",
      "status": 200,
      "found": true,
      "count": 1
    }
  ],
  "pass": true
}
Evidence: Scenario 6 Trailing-i vs non-i boundary check result
{
  "scenario": "Scenario 6 (Adversarial / Boundary): Queries ending in i/I bypass FTS while non-i queries use FTS",
  "checks": [
    {
      "query": "ELI",
      "endsInI": true,
      "expectedFts": false,
      "status": 200,
      "found": true
    },
    {
      "query": "alex",
      "endsInI": false,
      "expectedFts": true,
      "status": 200,
      "found": true
    }
  ],
  "pass": true
}
Evidence: Scenario 7 Short and control character boundary check result
{
  "scenario": "Scenario 7 (Adversarial / Boundary): Short queries (< 3 chars) and control characters fall back safely",
  "checks": [
    {
      "query": "al",
      "length": 2,
      "status": 200,
      "found": true
    },
    {
      "query": "ORD-SYNTH-TAB\\t123",
      "status": 200,
      "found": true
    },
    {
      "query": "test\\n\\r\\x7F",
      "status": 200,
      "noError": true
    }
  ],
  "pass": true
}

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Non-ASCII Unicode search for Georgian Mkhedruli script returns order with Georgian Mtavruli customer name ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_1_georgian_search.json
Non-ASCII Unicode search for decomposed Turkish lowercase returns order with composed dotted capital customer name ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_2_turkish_decomposed_search.json
Trailing ASCII i query bypasses FTS5 trigram pre-filtering and matches Turkish customer with uppercase dotted İ ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_3_turkish_trailing_i_search.json
Non-ASCII Unicode order number search returns orders with non-ASCII identifiers via UDF fallback ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_4_non_ascii_order_number_search.json
Printable ASCII queries of length >= 3 not ending in i/I preserve FTS5 trigram fast path for orders, customers, and phone digits ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_5_ascii_fts_fastpath_search.json
Adversarial boundary check for queries ending in i/I (bypassing FTS) vs non-i queries (using FTS) ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_6_boundary_trailing_i_vs_non_i.json
Adversarial boundary check for short queries (< 3 chars) and queries containing control characters ✅ pass live ~/.no-mistakes/evidence/01M5EJ13QMF1DTWS6A7BZ2EARK/scenario_7_boundary_short_and_control_chars.json
  • npm run test:orders-search (includes tests/orders-search.test.ts, tests/orders-search-api.test.ts, and tests/orders-search-performance.test.ts)
  • Live scenario driver drive_scenarios.js against standalone HTTP Express server on port 3001 with isolated SQLite test database
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4cc44986-d87d-4ca5-807e-1eb1fe847177

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at plus

@greptile-apps

greptile-apps Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new actionable issues were found.

Summary

Order search now skips FTS filtering for Unicode queries and queries ending in i or I, preserving matches through udfClause.

  • Order searches skip FTS for Unicode and trailing-i queries.

Reviews (2) · Last reviewed commit: "test(orders): isolate customer ali match..." · Reviewed by Greptile

Comment thread tests/orders-search-api.test.ts Resolved
Comment thread tests/orders-search-api.test.ts Resolved
@khaira777 khaira777 changed the title fix(main): keep order search FTS candidates a superset of Unicode queries fix(orders): keep FTS search candidates a superset of Unicode queries Oct 21, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at plus

@khaira777
khaira777 merged commit a24500d into main Oct 21, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/remediate-n4-unicode-search branch October 21, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(orders): keep FTS5 trigram search candidates a superset of Unicode case-folded matches

1 participant