Done
Details
Details
Assignee
Damien
DamienReporter
Damien
DamienPriority
Story Points
1
Sprint
None
Development Team
Thunderjet
Fix versions
Release
Lotus R1 2022
TestRail: Cases
Open TestRail: Cases
TestRail: Runs
Open TestRail: Runs
Created November 8, 2021 at 9:12 PM
Updated November 25, 2021 at 5:26 PM
Resolved November 12, 2021 at 11:49 AM
Purpose/Overview:
With simple order line queries such as
/orders/order-lines?query=paymentStatus==Open
mod-orders will try to use poLine.acqUnitIds, which does not exist.
This warning will be visible in mod-orders-storage:
{color:#000000}WARNING: Doing LIKE search without index for po_line.jsonb->>'acqUnitIds', CQL >>> SQL: acqUnitId{color}
{{ s <> [] >>> lower(f_unaccent(po_line.jsonb->>'acqUnitIds')) NOT LIKE lower(f_unaccent('[]'))}}
The issue is in AcquisitionsUnitsService#buildAcqUnitsCqlExprToSearchRecords. The tableAlias argument is not used when an empty list of ids is retrieved.
The issue was introduced in Juniper by .
Consequences of the issue:
All matching order lines are returned for a query of a user who is not associated with any acquisition unit, even order lines of an order with an acquisition unit.
Potential slowdown of all order line queries
Requirements/Scope:
Fix
buildAcqUnitsCqlExprToSearchRecords
.Approach:
Include
tableAlias
intoNO_ACQ_UNIT_ASSIGNED_CQL
.Acceptance criteria:
Check that a user who is not allowed to see an order line because of acquisition units is indeed not seeing it when doing a query for po lines. Also make sure no warning is visible in mod-orders-storage after fixing.